fix(release): do not include dirname assets
in checksums.txt
#18
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ${{ matrix.platform.os }} | |
strategy: | |
matrix: | |
# cross compile to these targets. | |
# see https://qiita.com/okmt765/items/ad3cdfb5850e68edcef0 | |
# see https://dzfrias.dev/blog/deploy-rust-cross-platform-github-actions | |
platform: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.platform.target }} | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target ${{ matrix.platform.target }} | |
- run: | | |
ARCHIVE_NAME=jsonwith-${{ github.ref_name }}-${{ matrix.platform.target }}; | |
mkdir $ARCHIVE_NAME; | |
mv target/${{ matrix.platform.target }}/release/jsonwith $ARCHIVE_NAME/jsonwith; | |
tar -czf $ARCHIVE_NAME.tar.gz $ARCHIVE_NAME; | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: release-artifact | |
path: jsonwith-${{ github.ref_name }}-${{ matrix.platform.target }}.tar.gz | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: release-artifact | |
path: assets | |
- run: ls -la assets | |
- run: shasum -a 256 *.tar.gz > checksums.txt | |
working-directory: assets | |
- run: | | |
cat <<'EOF' | envsubst > release.md | |
# jsonwith ${{ github.ref_name }} | |
## Installation | |
```bash | |
cargo install --git https://github.com/enuesaa/jsonwith --tag ${{ github.ref_name }} | |
``` | |
EOF | |
- uses: softprops/action-gh-release@v1 | |
with: | |
prerelease: true | |
body_path: release.md | |
files: assets/* |