v0.3.1 #14
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: | |
branches: | |
- release* | |
tags: | |
- 'v*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Deps | |
run: | | |
sudo apt-get install -y musl-tools | |
rustup target add x86_64-unknown-linux-musl | |
- name: Build static executables | |
run: | | |
make static | |
cp target/x86_64-unknown-linux-musl/release/treereduce-{c,java,javascript,lua,rust,souffle,swift} . | |
- uses: ncipollo/release-action@v1 | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
with: | |
artifacts: "treereduce-c,treereduce-java,treereduce-javascript,treereduce-lua,treereduce-rust,treereduce-souffle,treereduce-swift" | |
artifactErrorsFailBuild: true | |
body: "See [CHANGELOG.md](https://github.com/langston-barrett/treereduce/blob/main/doc/CHANGELOG.md)." | |
draft: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish to crates.io | |
env: | |
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} | |
# Only push on actual release tags | |
PUSH: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
run: | | |
for pkg in treereduce{,-c,-java,-javascript,-lua,-rust,-souffle,-swift}; do | |
if [[ ${PUSH} == true ]]; then | |
cargo publish --token ${CRATES_IO_TOKEN} -p "${pkg}" | |
else | |
cargo publish --dry-run --token ${CRATES_IO_TOKEN} -p "${pkg}" | |
break | |
fi | |
sleep 5 | |
done |