mirror of
https://github.com/casey/just.git
synced 2025-08-04 15:08:39 +00:00
Publish single SHA256SUM file with releases (#2417)
This commit is contained in:
parent
6230354ec0
commit
d195d77b32
2 changed files with 55 additions and 17 deletions
70
.github/workflows/release.yaml
vendored
70
.github/workflows/release.yaml
vendored
|
@ -10,7 +10,23 @@ defaults:
|
|||
shell: bash
|
||||
|
||||
jobs:
|
||||
release:
|
||||
prerelease:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
outputs:
|
||||
value: ${{ steps.prerelease.outputs.value }}
|
||||
|
||||
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
|
||||
|
||||
package:
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
|
@ -49,6 +65,9 @@ jobs:
|
|||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
needs:
|
||||
- prerelease
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
@ -69,15 +88,6 @@ jobs:
|
|||
run: |
|
||||
rustup target add aarch64-pc-windows-msvc
|
||||
|
||||
- name: Release Type
|
||||
id: release-type
|
||||
run: |
|
||||
if [[ ${{ github.ref }} =~ ^refs/tags/[0-9]+[.][0-9]+[.][0-9]+$ ]]; then
|
||||
echo value=release >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo value=prerelease >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Generate Completion Scripts and Manpage
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
|
@ -104,10 +114,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: ${{ needs.prerelease.outputs.value }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
@ -121,6 +129,38 @@ jobs:
|
|||
with:
|
||||
draft: false
|
||||
files: CHANGELOG.md
|
||||
prerelease: ${{ steps.ref-type.outputs.value != 'release' }}
|
||||
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 }}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue