From 2b98316d2078654b8e6555a30ca4dd51769f8f60 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Mon, 9 Dec 2024 02:58:31 -0500 Subject: [PATCH] v1.10.8 --- .github/workflows/build.yml | 50 +++++++++++---- .github/workflows/test.yml | 30 +-------- .github/workflows/uploadBuilds.yml | 94 ----------------------------- .github/workflows/uploadPlugins.yml | 46 -------------- 4 files changed, 40 insertions(+), 180 deletions(-) delete mode 100644 .github/workflows/uploadBuilds.yml delete mode 100644 .github/workflows/uploadPlugins.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 754f63d8..027eef77 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,10 +6,40 @@ on: env: FORCE_COLOR: true GITHUB_TOKEN: ${{ secrets.ETOKEN }} + REPO: Equicord/Equibored + USERNAME: GitHub-Actions permissions: write-all jobs: + Date: + name: Date + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + outputs: + DATE: ${{ steps.combined.outputs.DATE }} + TIME: ${{ steps.combined.outputs.TIME }} + + steps: + - name: Get Month Day Year + id: date + uses: Kaven-Universe/github-action-current-date-time@v1 + with: + timezone-offset: 240 + + - name: Combine Time + id: combined + run: | + echo "DATE=$YEAR/$MONTH/$DAY" >> $GITHUB_OUTPUT + echo "TIME=$HOURS-$MINUTES-$SECONDS" >> $GITHUB_OUTPUT + env: + YEAR: ${{ steps.date.outputs.year }} + MONTH: ${{ steps.date.outputs.month }} + DAY: ${{ steps.date.outputs.day }} + HOURS: ${{ steps.date.outputs.hours }} + MINUTES: ${{ steps.date.outputs.minutes }} + SECONDS: ${{ steps.date.outputs.seconds }} + Build: name: Build Equicord runs-on: ubuntu-latest @@ -68,23 +98,21 @@ jobs: rm release/*.map - name: get-npm-version - if: ${{ github.ref_name == 'main' }} id: package-version uses: martinbeentjes/npm-get-version-action@v1.3.1 - - name: Upload Equicord Stable - if: ${{ github.ref_name == 'main' }} + - name: Upload Equicord run: | gh release create v${{ steps.package-version.outputs.current-version}} --latest=false gh release upload v${{ steps.package-version.outputs.current-version}} --clobber dist/release/* - - name: Upload Equicord Dev - if: ${{ github.ref_name == 'dev' }} + - name: Upload Plugins JSON to Equibored repo run: | - gh release upload devbuild --clobber dist/release/* + git clone https://$USERNAME:$GITHUB_TOKEN@github.com/$REPO.git plugins + cd plugins - - name: Upload build artifact - uses: actions/upload-artifact@v4 - with: - name: "build" - path: "dist/release/*" + cp dist/release/*plugins.json . + git add -A + + git commit -m "Plugins for https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA" + git push --force https://$USERNAME:$GITHUB_TOKEN@github.com/$REPO.git diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 923a74fa..708974e6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,35 +11,7 @@ on: jobs: Test: - name: Test For Pushes - if: ${{ github.event_name == 'push' }} - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v3 # Install pnpm using packageManager key in package.json - - - name: Use Node.js 20 - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "pnpm" - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Lint & Test if desktop version compiles - run: pnpm test - - - name: Test if web version compiles - run: pnpm buildWeb - - - name: Test if plugin structure is valid - run: pnpm generatePluginJson - - TestForPRs: - name: Test For Pull Requests - if: ${{ github.event_name == 'pull_request' }} + name: Test runs-on: ubuntu-latest steps: diff --git a/.github/workflows/uploadBuilds.yml b/.github/workflows/uploadBuilds.yml deleted file mode 100644 index 989db697..00000000 --- a/.github/workflows/uploadBuilds.yml +++ /dev/null @@ -1,94 +0,0 @@ -name: Upload Builds -on: - workflow_run: - workflows: [Release] - types: [completed] - branches: [main, dev] -env: - FORCE_COLOR: true - REPO: Equicord/Builds - TOKEN: ${{ secrets.ETOKEN }} - USERNAME: GitHub-Actions -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - -permissions: write-all - -jobs: - Date: - name: Date - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - outputs: - DATE: ${{ steps.combined.outputs.DATE }} - TIME: ${{ steps.combined.outputs.TIME }} - - steps: - - name: Get Month Day Year - id: date - uses: Kaven-Universe/github-action-current-date-time@v1 - with: - timezone-offset: 240 - - - name: Combine Time - id: combined - run: | - echo "DATE=$YEAR/$MONTH/$DAY" >> $GITHUB_OUTPUT - echo "TIME=$HOURS-$MINUTES-$SECONDS" >> $GITHUB_OUTPUT - env: - YEAR: ${{ steps.date.outputs.year }} - MONTH: ${{ steps.date.outputs.month }} - DAY: ${{ steps.date.outputs.day }} - HOURS: ${{ steps.date.outputs.hours }} - MINUTES: ${{ steps.date.outputs.minutes }} - SECONDS: ${{ steps.date.outputs.seconds }} - - Upload: - name: Upload Build - runs-on: ubuntu-latest - needs: Date - env: - DATE: ${{ needs.Date.outputs.DATE }} - TIME: ${{ needs.Date.outputs.TIME }} - - steps: - - uses: actions/checkout@v4 - - - name: Setup Actions User - run: | - git config --global user.name "GitHub-Actions" - git config --global user.email actions@github.com - - - name: Download build artifact from triggered workflow - uses: dawidd6/action-download-artifact@v2 - with: - run_id: ${{ github.event.workflow_run.id }} - name: build - path: ./release - search_artifacts: true - - - name: Upload Stable Build to Builds repo - if: ${{ github.event.workflow_run.head_branch == 'main' }} - run: | - git clone https://$USERNAME:$TOKEN@github.com/$REPO.git builds - cd builds - - mkdir -p stable/$DATE/$TIME - cp -r ../release/* ./stable/$DATE/$TIME - - git add -A - git commit -m "Stable Build for https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA" - git push --force https://$USERNAME:$TOKEN@github.com/$REPO.git - - - name: Upload Dev Build To Builds Repo - if: ${{ github.event.workflow_run.head_branch == 'dev' }} - run: | - git clone https://$USERNAME:$TOKEN@github.com/$REPO.git builds - cd builds - - mkdir -p devbuilds/$DATE/$TIME - cp -r ../release/* ./devbuilds/$DATE/$TIME - - git add -A - git commit -m "Dev Build for https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA" - git push --force https://$USERNAME:$TOKEN@github.com/$REPO.git diff --git a/.github/workflows/uploadPlugins.yml b/.github/workflows/uploadPlugins.yml deleted file mode 100644 index 8edd474f..00000000 --- a/.github/workflows/uploadPlugins.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Upload Plugins JSONs -on: - workflow_run: - workflows: [Release] - types: [completed] - branches: [main] -env: - FORCE_COLOR: true - REPO: Equicord/Equibored - TOKEN: ${{ secrets.ETOKEN }} - USERNAME: GitHub-Actions - -permissions: write-all - -jobs: - Upload: - name: Upload Plugins - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - - steps: - - uses: actions/checkout@v4 - - - name: Setup Actions User - run: | - git config --global user.name "GitHub-Actions" - git config --global user.email actions@github.com - - - name: Download build artifact from triggered workflow - uses: dawidd6/action-download-artifact@v2 - with: - run_id: ${{ github.event.workflow_run.id }} - name: build - path: ./release - search_artifacts: true - - - name: Upload Plugins JSON to Equibored repo - run: | - git clone https://$USERNAME:$TOKEN@github.com/$REPO.git plugins - cd plugins - - cp ../release/*plugins.json . - git add -A - - git commit -m "Plugins for https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA" - git push --force https://$USERNAME:$TOKEN@github.com/$REPO.git