Release refs/tags/0.1.5 #22
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-version | |
run-name: "Release ${{ github.event.ref }}" | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build code | |
run: cargo build --release | |
- name: Save binary artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: binary-linux | |
path: target/release/margo | |
- name: Package code | |
run: cargo package | |
- name: Save package artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: package | |
path: target/package/margo-*.crate | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build code | |
run: cargo build --release | |
- name: Save binary artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: binary-windows | |
path: target/release/margo.exe | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build code | |
run: cargo build --release | |
- name: Save binary artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: binary-macos-aarch64 | |
path: target/release/margo | |
release: | |
runs-on: ubuntu-latest | |
needs: [build-linux, build-windows, build-macos] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Determine tag | |
run: | | |
tag=$(echo ${{github.event.ref}} | cut -d/ -f3) | |
echo "tag=${tag}" >> $GITHUB_ENV | |
- name: Download binary artifacts (Linux) | |
uses: actions/download-artifact@v4 | |
with: | |
name: binary-linux | |
path: linux | |
- name: Download binary artifacts (Windows) | |
uses: actions/download-artifact@v4 | |
with: | |
name: binary-windows | |
path: windows | |
- name: Download binary artifacts (macOS) | |
uses: actions/download-artifact@v4 | |
with: | |
name: binary-macos-aarch64 | |
path: macos-aarch64 | |
- name: Fix artifact permissions | |
run: chmod +x {linux,macos-aarch64}/margo | |
- name: Compress artifacts | |
run: | | |
tar czf margo-linux-x86_64.tar.gz -C linux margo | |
tar czf margo-macos-aarch64.tar.gz -C macos-aarch64 margo | |
pushd windows; zip ../margo-windows-x86_64.exe.zip margo.exe; popd | |
- name: Release | |
run: | | |
gh release create ${tag} \ | |
margo-linux-x86_64.tar.gz \ | |
margo-macos-aarch64.tar.gz \ | |
margo-windows-x86_64.exe.zip | |
env: | |
GH_TOKEN: ${{ github.token }} | |
publish: | |
runs-on: ubuntu-latest | |
needs: build-linux | |
steps: | |
- name: Checkout GitHub Pages | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
- name: Determine tag | |
run: | | |
tag=$(echo ${{github.event.ref}} | cut -d/ -f3) | |
echo "tag=${tag}" >> $GITHUB_ENV | |
- name: Download package artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: package | |
path: package | |
- name: Publish crate | |
uses: integer32llc/margo-actions@main | |
with: | |
crates: package/*.crate | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Commit and push to GitHub Pages | |
run: |- | |
set -eu | |
git config user.email "margo@integer32.com" | |
git config user.name "Margo GitHub Action" | |
git add . | |
git commit -m "Release ${tag}" | |
git push origin gh-pages |