Skip to content

Commit

Permalink
Add a release action
Browse files Browse the repository at this point in the history
  • Loading branch information
shepmaster committed Apr 24, 2024
1 parent d81343c commit e6ed851
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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

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 }}

0 comments on commit e6ed851

Please sign in to comment.