-
Notifications
You must be signed in to change notification settings - Fork 14
40 lines (36 loc) · 1.09 KB
/
github-release.yml
File metadata and controls
40 lines (36 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Github Release
on:
workflow_dispatch:
push:
tags:
- "v*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
extract-crate-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Export Crate Package Version
run: echo "VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].version')" >> $GITHUB_OUTPUT
id: export_crate_version
outputs:
VERSION: ${{ steps.export_crate_version.outputs.VERSION }}
release:
name: Release on Github
runs-on: ubuntu-latest
permissions:
contents: write
needs: [extract-crate-version]
env:
VERSION: ${{ needs.extract-crate-version.outputs.VERSION }}
steps:
- uses: actions/checkout@v6
- run: cargo build --release
- name: Generate the Release Tarball
run: tar --directory=target/release -cf release.tar.gz $(ls -U target/release/ | head -1)
- uses: ncipollo/release-action@v1
with:
artifacts: "release.tar.gz"
tag: v${{ env.VERSION }}