From a38ddcf8e70efcc5bc414625573dc19f47cd2b2f Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 7 Oct 2024 22:45:41 -0700 Subject: [PATCH 1/9] Publish single SHA256SUM file with releases --- .github/workflows/release.yaml | 52 +++++++++++++++++++++++++++------- bin/package | 2 -- 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c4ca8971d2..e8170392a8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,7 +10,39 @@ defaults: shell: bash jobs: - release: + manifest: + runs-on: ubuntu-latest + + needs: + - package + + - name: Prerelease Check + id: prerelease + run: | + if [[ ${{ github.ref_name }} =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then + echo value=false >> $GITHUB_OUTPUT + else + echo value=true >> $GITHUB_OUTPUT + fi + + - name: Download Release Archives + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release download --repo casey/just --pattern '*' --dir release + + - name: Create Checksums + run: cd release && shasum -a 256 * > ../SHA256SUMS + + - name: Publish Checksums + uses: softprops/action-gh-release@v2.0.8 + with: + draft: false + files: SHA256SUMS + prerelease: ${{ steps.prerelease.outputs.value }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + package: strategy: matrix: target: @@ -69,13 +101,13 @@ jobs: run: | rustup target add aarch64-pc-windows-msvc - - name: Release Type - id: release-type + - name: Prerelease Check + id: prerelease run: | - if [[ ${{ github.ref }} =~ ^refs/tags/[0-9]+[.][0-9]+[.][0-9]+$ ]]; then - echo value=release >> $GITHUB_OUTPUT + if [[ ${{ github.ref_name }} =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then + echo value=false >> $GITHUB_OUTPUT else - echo value=prerelease >> $GITHUB_OUTPUT + echo value=true >> $GITHUB_OUTPUT fi - name: Generate Completion Scripts and Manpage @@ -104,10 +136,8 @@ jobs: if: ${{ startsWith(github.ref, 'refs/tags/') }} with: draft: false - files: | - ${{ steps.package.outputs.archive }} - ${{ steps.package.outputs.archive }}.sha256sum - prerelease: ${{ steps.release-type.outputs.value == 'prerelease' }} + files: ${{ steps.package.outputs.archive }} + prerelease: ${{ steps.prerelease.outputs.value }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -121,6 +151,6 @@ jobs: with: draft: false files: CHANGELOG.md - prerelease: ${{ steps.ref-type.outputs.value != 'release' }} + prerelease: ${{ steps.prerelease.outputs.value }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/bin/package b/bin/package index 8372325287..ba4bb1ea0b 100755 --- a/bin/package +++ b/bin/package @@ -44,13 +44,11 @@ case $OS in ubuntu-latest | macos-latest) ARCHIVE=just-$VERSION-$TARGET.tar.gz tar czf $ARCHIVE * - shasum -a 256 $ARCHIVE > $ARCHIVE.sha256sum echo "archive=$DIST/$ARCHIVE" >> $GITHUB_OUTPUT ;; windows-latest) ARCHIVE=just-$VERSION-$TARGET.zip 7z a $ARCHIVE * - sha256sum $ARCHIVE > $ARCHIVE.sha256sum echo "archive=`pwd -W`/$ARCHIVE" >> $GITHUB_OUTPUT ;; esac From 6cb7d1326087ae8f8429dee1e47071301746d47b Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 7 Oct 2024 22:50:32 -0700 Subject: [PATCH 2/9] Reform --- .github/workflows/release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e8170392a8..5369d6d9ce 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,7 +10,7 @@ defaults: shell: bash jobs: - manifest: + checksums: runs-on: ubuntu-latest needs: @@ -28,10 +28,10 @@ jobs: - name: Download Release Archives env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release download --repo casey/just --pattern '*' --dir release + run: "gh release download --repo casey/just --pattern '*' --dir release" - name: Create Checksums - run: cd release && shasum -a 256 * > ../SHA256SUMS + run: "cd release && shasum -a 256 * > ../SHA256SUMS" - name: Publish Checksums uses: softprops/action-gh-release@v2.0.8 From e1c32b0f1323e1908ec50d1a7803072fad91b7b1 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 7 Oct 2024 22:51:05 -0700 Subject: [PATCH 3/9] Tweak --- .github/workflows/release.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5369d6d9ce..b144692e0d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,10 +28,16 @@ jobs: - name: Download Release Archives env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: "gh release download --repo casey/just --pattern '*' --dir release" + run: >- + gh release download + --repo casey/just + --pattern '*' + --dir release" - name: Create Checksums - run: "cd release && shasum -a 256 * > ../SHA256SUMS" + run: | + cd release + shasum -a 256 * > ../SHA256SUMS" - name: Publish Checksums uses: softprops/action-gh-release@v2.0.8 From 5af34312a1228278be4f822bae06891cdadfd518 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 7 Oct 2024 22:53:55 -0700 Subject: [PATCH 4/9] Tweak --- .github/workflows/release.yaml | 74 +++++++++++++++++----------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b144692e0d..d587e88520 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,43 +10,43 @@ defaults: shell: bash jobs: - checksums: - runs-on: ubuntu-latest - - needs: - - package - - - name: Prerelease Check - id: prerelease - run: | - if [[ ${{ github.ref_name }} =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then - echo value=false >> $GITHUB_OUTPUT - else - echo value=true >> $GITHUB_OUTPUT - fi - - - name: Download Release Archives - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: >- - gh release download - --repo casey/just - --pattern '*' - --dir release" - - - name: Create Checksums - run: | - cd release - shasum -a 256 * > ../SHA256SUMS" - - - name: Publish Checksums - uses: softprops/action-gh-release@v2.0.8 - with: - draft: false - files: SHA256SUMS - prerelease: ${{ steps.prerelease.outputs.value }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # checksums: + # runs-on: ubuntu-latest + + # needs: + # - package + + # - name: Prerelease Check + # id: prerelease + # run: | + # if [[ ${{ github.ref_name }} =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then + # echo value=false >> $GITHUB_OUTPUT + # else + # echo value=true >> $GITHUB_OUTPUT + # fi + + # - name: Download Release Archives + # env: + # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: >- + # gh release download + # --repo casey/just + # --pattern '*' + # --dir release" + + # - name: Create Checksums + # run: | + # cd release + # shasum -a 256 * > ../SHA256SUMS" + + # - name: Publish Checksums + # uses: softprops/action-gh-release@v2.0.8 + # with: + # draft: false + # files: SHA256SUMS + # prerelease: ${{ steps.prerelease.outputs.value }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} package: strategy: From b69e317218d9578b356b54d01b37c920c5c4f871 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 7 Oct 2024 22:56:01 -0700 Subject: [PATCH 5/9] Adjust --- .github/workflows/release.yaml | 75 +++++++++++++++++----------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d587e88520..554217600a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,43 +10,44 @@ defaults: shell: bash jobs: - # checksums: - # runs-on: ubuntu-latest - - # needs: - # - package - - # - name: Prerelease Check - # id: prerelease - # run: | - # if [[ ${{ github.ref_name }} =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then - # echo value=false >> $GITHUB_OUTPUT - # else - # echo value=true >> $GITHUB_OUTPUT - # fi - - # - name: Download Release Archives - # env: - # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: >- - # gh release download - # --repo casey/just - # --pattern '*' - # --dir release" - - # - name: Create Checksums - # run: | - # cd release - # shasum -a 256 * > ../SHA256SUMS" - - # - name: Publish Checksums - # uses: softprops/action-gh-release@v2.0.8 - # with: - # draft: false - # files: SHA256SUMS - # prerelease: ${{ steps.prerelease.outputs.value }} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + checksums: + runs-on: ubuntu-latest + + needs: + - package + + steps: + - name: Prerelease Check + id: prerelease + run: | + if [[ ${{ github.ref_name }} =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then + echo value=false >> $GITHUB_OUTPUT + else + echo value=true >> $GITHUB_OUTPUT + fi + + - name: Download Release Archives + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: >- + gh release download + --repo casey/just + --pattern '*' + --dir release" + + - name: Create Checksums + run: | + cd release + shasum -a 256 * > ../SHA256SUMS" + + - name: Publish Checksums + uses: softprops/action-gh-release@v2.0.8 + with: + draft: false + files: SHA256SUMS + prerelease: ${{ steps.prerelease.outputs.value }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} package: strategy: From 0e1d2139d36421f9d01a62cb5ff61e0529174744 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 7 Oct 2024 23:01:17 -0700 Subject: [PATCH 6/9] Reform --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 554217600a..4d354e4dfb 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,7 +10,7 @@ defaults: shell: bash jobs: - checksums: + checksum: runs-on: ubuntu-latest needs: @@ -33,7 +33,7 @@ jobs: gh release download --repo casey/just --pattern '*' - --dir release" + --dir release - name: Create Checksums run: | From ec593ab44b1c64c9cf26cf588403a579af8227ae Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 7 Oct 2024 23:06:15 -0700 Subject: [PATCH 7/9] Revise --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4d354e4dfb..2dfe49ddcf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -38,7 +38,7 @@ jobs: - name: Create Checksums run: | cd release - shasum -a 256 * > ../SHA256SUMS" + shasum -a 256 * > ../SHA256SUMS - name: Publish Checksums uses: softprops/action-gh-release@v2.0.8 From ce0aeb72a2d248ce7570f42c2b727c5e73c8fa9f Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 7 Oct 2024 23:13:00 -0700 Subject: [PATCH 8/9] Reform --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2dfe49ddcf..684c4f5437 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -34,6 +34,7 @@ jobs: --repo casey/just --pattern '*' --dir release + ${{ github.ref_name }} - name: Create Checksums run: | From f590971a861d10bf99c7705ce7e2879b44bdee50 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 8 Oct 2024 11:57:45 -0700 Subject: [PATCH 9/9] Deduplicate pre-release check --- .github/workflows/release.yaml | 78 +++++++++++++++++----------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 684c4f5437..525eea999f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,11 +10,11 @@ defaults: shell: bash jobs: - checksum: + prerelease: runs-on: ubuntu-latest - needs: - - package + outputs: + value: ${{ steps.prerelease.outputs.value }} steps: - name: Prerelease Check @@ -26,30 +26,6 @@ jobs: echo value=true >> $GITHUB_OUTPUT fi - - name: Download Release Archives - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: >- - gh release download - --repo casey/just - --pattern '*' - --dir release - ${{ github.ref_name }} - - - name: Create Checksums - run: | - cd release - shasum -a 256 * > ../SHA256SUMS - - - name: Publish Checksums - uses: softprops/action-gh-release@v2.0.8 - with: - draft: false - files: SHA256SUMS - prerelease: ${{ steps.prerelease.outputs.value }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - package: strategy: matrix: @@ -89,6 +65,9 @@ jobs: runs-on: ${{matrix.os}} + needs: + - prerelease + steps: - uses: actions/checkout@v4 @@ -109,15 +88,6 @@ jobs: run: | rustup target add aarch64-pc-windows-msvc - - name: Prerelease Check - id: prerelease - run: | - if [[ ${{ github.ref_name }} =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then - echo value=false >> $GITHUB_OUTPUT - else - echo value=true >> $GITHUB_OUTPUT - fi - - name: Generate Completion Scripts and Manpage run: | set -euxo pipefail @@ -145,7 +115,7 @@ jobs: with: draft: false files: ${{ steps.package.outputs.archive }} - prerelease: ${{ steps.prerelease.outputs.value }} + prerelease: ${{ needs.prerelease.outputs.value }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -159,6 +129,38 @@ jobs: with: draft: false files: CHANGELOG.md - prerelease: ${{ steps.prerelease.outputs.value }} + prerelease: ${{ needs.prerelease.outputs.value }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + checksum: + runs-on: ubuntu-latest + + needs: + - prerelease + - package + + steps: + - name: Download Release Archives + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: >- + gh release download + --repo casey/just + --pattern '*' + --dir release + ${{ github.ref_name }} + + - name: Create Checksums + run: | + cd release + shasum -a 256 * > ../SHA256SUMS + + - name: Publish Checksums + uses: softprops/action-gh-release@v2.0.8 + with: + draft: false + files: SHA256SUMS + prerelease: ${{ needs.prerelease.outputs.value }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}