From a16f241b856aa508dfbf2662984939bd6cbb8dde Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:23:16 -0400 Subject: [PATCH] Revert "Rework More" This reverts commit 4ae1d01dd3718bbb0ce4bacad38e801675919cce. --- .github/workflows/build.yml | 51 ++-------- .github/workflows/buildDev.yml | 113 ---------------------- .github/workflows/reportBrokenPlugins.yml | 3 +- .github/workflows/uploadBuilds.yml | 64 +++++++----- .github/workflows/uploadPlugins.yml | 7 +- 5 files changed, 54 insertions(+), 184 deletions(-) delete mode 100644 .github/workflows/buildDev.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5da41bea4..5dd6bdbe3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,9 @@ -name: Release Stable +name: Release on: push: branches: - main + - dev env: FORCE_COLOR: true GITHUB_TOKEN: ${{ secrets.ETOKEN }} @@ -10,40 +11,9 @@ env: permissions: write-all jobs: - Date: - name: Date - runs-on: ubuntu-latest - 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 Stable + name: Build Equicord runs-on: ubuntu-latest - needs: Date - env: - DATE: ${{ needs.Date.outputs.DATE }} - TIME: ${{ needs.Date.outputs.TIME }} steps: - uses: actions/checkout@v4 @@ -66,7 +36,7 @@ jobs: run: pnpm buildStandalone - name: Generate plugin list - run: pnpm generatePluginJson dist/allplugins.json + run: pnpm generatePluginJson dist/vencordplugins.json - name: Generate Equicord plugin list run: pnpm generateEquicordPluginJson dist/equicordplugins.json @@ -99,18 +69,17 @@ jobs: rm release/*.map - name: Upload Equicord Stable + if: ${{ github.ref_name == 'main' }} run: | gh release upload latest --clobber dist/release/* - - name: Move Files To Date Time dir + - name: Upload Equicord Dev + if: ${{ github.ref_name == 'dev' }} run: | - mkdir -p $DATE/$TIME - mv /dist/release/* $DATE/$TIME - cd $DATE/$TIME - echo '$DATE/$TIME' >> time.txt + gh release upload devbuild --clobber dist/release/* - name: Upload build artifact uses: actions/upload-artifact@v4 with: - name: "buildStable" - path: "$DATE/$TIME/*" + name: "build" + path: "dist/release/*" diff --git a/.github/workflows/buildDev.yml b/.github/workflows/buildDev.yml deleted file mode 100644 index a07f70478..000000000 --- a/.github/workflows/buildDev.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: Release Dev -on: - push: - branches: - - dev -env: - FORCE_COLOR: true - GITHUB_TOKEN: ${{ secrets.ETOKEN }} - -permissions: write-all - -jobs: - Date: - name: Date - runs-on: ubuntu-latest - 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 Dev - runs-on: ubuntu-latest - needs: Date - env: - DATE: ${{ needs.Date.outputs.DATE }} - TIME: ${{ needs.Date.outputs.TIME }} - - steps: - - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v3 - - - 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: Build web - run: pnpm buildWeb - - - name: Build - run: pnpm build - - - name: Generate plugin list - run: pnpm generatePluginJson dist/allplugins.json - - - name: Collect files to be released - run: | - cd dist - mkdir release - - cp browser/browser.* release - cp Vencord.user.{js,js.LEGAL.txt} release - - # copy the plugin data jsons, the extension zips and the desktop/vesktop asars - cp *.{json,zip,asar} release - - # legacy un-asared files - # FIXME: remove at some point - cp desktop/* release - for file in vesktop/*; do - filename=$(basename "$file") - cp "$file" "release/vencordDesktop${filename^}" - done - for file in equibop/*; do - filename=$(basename "$file") - cp "$file" "release/equicordDesktop${filename^}" - done - - find release -size 0 -delete - rm release/package.json - rm release/*.map - - - name: Upload Equicord Dev - run: | - gh release upload devbuild --clobber dist/release/* - - - name: Move Files To Date Time dir - run: | - mkdir -p $DATE/$TIME - mv /dist/release/* $DATE/$TIME - cd $DATE/$TIME - echo '$DATE/$TIME' >> time.txt - - - name: Upload build artifact - uses: actions/upload-artifact@v4 - with: - name: "buildDev" - path: "$DATE/$TIME/*" diff --git a/.github/workflows/reportBrokenPlugins.yml b/.github/workflows/reportBrokenPlugins.yml index b4d536527..0abfee5b2 100644 --- a/.github/workflows/reportBrokenPlugins.yml +++ b/.github/workflows/reportBrokenPlugins.yml @@ -2,6 +2,7 @@ name: Test Patches on: workflow_dispatch: schedule: + # Every day at midnight - cron: 0 0 * * * jobs: @@ -18,7 +19,7 @@ jobs: - uses: actions/checkout@v4 if: ${{ github.event_name == 'workflow_dispatch' }} - - uses: pnpm/action-setup@v3 + - uses: pnpm/action-setup@v3 # Install pnpm using packageManager key in package.json - name: Use Node.js 20 uses: actions/setup-node@v4 diff --git a/.github/workflows/uploadBuilds.yml b/.github/workflows/uploadBuilds.yml index 4f7fe2aa6..989db6979 100644 --- a/.github/workflows/uploadBuilds.yml +++ b/.github/workflows/uploadBuilds.yml @@ -1,11 +1,9 @@ name: Upload Builds on: - workflow_dispatch: workflow_run: - workflows: [Release Stable, Release Dev] + workflows: [Release] types: [completed] - schedule: - - cron: 0 0 * * * + branches: [main, dev] env: FORCE_COLOR: true REPO: Equicord/Builds @@ -17,9 +15,41 @@ concurrency: 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 @@ -30,37 +60,21 @@ jobs: git config --global user.email actions@github.com - name: Download build artifact from triggered workflow - if: ${{ github.event.workflow_run.head_branch == 'main' }} uses: dawidd6/action-download-artifact@v2 with: run_id: ${{ github.event.workflow_run.id }} - name: buildStable + name: build path: ./release search_artifacts: true - - name: Download build artifact from triggered workflow - if: ${{ github.event.workflow_run.head_branch == 'dev' }} - uses: dawidd6/action-download-artifact@v2 - with: - run_id: ${{ github.event.workflow_run.id }} - name: buildDev - path: ./${{ github.event.workflow_run.event }} - search_artifacts: true - - - name: Get time - id: time - run: | - cd release - echo "TIME=$(cat time.txt)" >> $GITHUB_ENV - - 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/$TIME - cp -r ../release/* ./stable/$TIME + 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" @@ -72,8 +86,8 @@ jobs: git clone https://$USERNAME:$TOKEN@github.com/$REPO.git builds cd builds - mkdir -p devbuilds/$TIME - cp -r ../release/* ./devbuilds/$TIME + 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" diff --git a/.github/workflows/uploadPlugins.yml b/.github/workflows/uploadPlugins.yml index f8481fffc..8edd474fd 100644 --- a/.github/workflows/uploadPlugins.yml +++ b/.github/workflows/uploadPlugins.yml @@ -1,11 +1,9 @@ name: Upload Plugins JSONs on: - workflow_dispatch: workflow_run: - workflows: [Release Stable] + workflows: [Release] types: [completed] - schedule: - - cron: 0 0 * * * + branches: [main] env: FORCE_COLOR: true REPO: Equicord/Equibored @@ -18,6 +16,7 @@ jobs: Upload: name: Upload Plugins runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v4