Release refs/tags/0.1.4 #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-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 | |
release: | |
runs-on: ubuntu-latest | |
needs: build-linux | |
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 | |
uses: actions/download-artifact@v4 | |
with: | |
name: binary-linux | |
path: linux | |
- name: Fix artifact permissions | |
run: chmod +x linux/margo | |
- name: Compress artifacts | |
run: tar czf margo-linux-x86_64.tar.gz -C linux margo | |
- name: Release | |
run: gh release create ${tag} margo-linux-x86_64.tar.gz | |
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 |