From a43edf6bcbfee4b4213530f7e672906633c099f8 Mon Sep 17 00:00:00 2001 From: eythaann Date: Sun, 13 Oct 2024 12:07:00 -0500 Subject: [PATCH] ci(nightly): update workflow --- .github/workflows/nightly.yml | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 896e02b7..7474166e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -26,13 +26,6 @@ jobs: - name: Confirm the tag was updated run: git ls-remote --tags origin - - name: Ensure release is updated to the latest commit - run: | - gh release edit nightly --tag nightly --target $(git rev-parse HEAD) --draft=false - - - name: Verify release status - run: gh release view nightly - build-installers: needs: continuous-integration permissions: @@ -93,23 +86,31 @@ jobs: prerelease: true args: ${{ matrix.args }} - publish-release: + remove-old-artifacts: needs: build-installers permissions: contents: write runs-on: ubuntu-latest steps: - - name: Publish release + - name: Remove Signatures and Old Artifacts uses: actions/github-script@v7 with: github-token: "${{ secrets.GITHUB_TOKEN }}" script: | + const tagName = 'nightly'; + const release = await github.rest.repos.getReleaseByTag({ + owner: context.repo.owner, + repo: context.repo.repo, + tag: tagName, + }); + const result = await github.rest.repos.listReleaseAssets({ owner: context.repo.owner, repo: context.repo.repo, - release_id: process.env.releaseId, + release_id: release.data.id, }); - result.data.forEach(async (asset) => { + + result.data.forEach(async (asset) => { if (asset.name.endsWith('.sig')) { await github.rest.repos.deleteReleaseAsset({ owner: context.repo.owner, @@ -118,9 +119,3 @@ jobs: }); } }); - await github.rest.repos.updateRelease({ - owner: context.repo.owner, - repo: context.repo.repo, - release_id: process.env.releaseId, - draft: false, - });