Skip to content

Commit

Permalink
Deduplicate pre-release check
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Oct 8, 2024
1 parent ce0aeb7 commit f590971
Showing 1 changed file with 40 additions and 38 deletions.
78 changes: 40 additions & 38 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]
with:
draft: false
files: SHA256SUMS
prerelease: ${{ steps.prerelease.outputs.value }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package:
strategy:
matrix:
Expand Down Expand Up @@ -89,6 +65,9 @@ jobs:

runs-on: ${{matrix.os}}

needs:
- prerelease

steps:
- uses: actions/checkout@v4

Expand All @@ -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
Expand Down Expand Up @@ -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 }}

Expand All @@ -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/[email protected]
with:
draft: false
files: SHA256SUMS
prerelease: ${{ needs.prerelease.outputs.value }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f590971

Please sign in to comment.