Skip to content

Commit bec8e6f

Browse files
committed
update release workflow
1 parent e489ed5 commit bec8e6f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
publish:
12+
name: Release for ${{ matrix.os }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
include:
17+
- os: ubuntu-latest
18+
asset_name: linux-amd64
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Build
23+
run: cargo build --release
24+
- name: Set the release version
25+
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
26+
- name: Create release artifacts
27+
run: |
28+
tar -czvf doh-cli-${{ env.RELEASE_VERSION }}-${{ matrix.asset_name }}.tar.gz \
29+
./target/release/doh-cli
30+
shasum -a 512 doh-cli-${{ env.RELEASE_VERSION }}-${{ matrix.asset_name }}.tar.gz \
31+
> doh-cli-${{ env.RELEASE_VERSION }}-${{ matrix.asset_name }}.tar.gz.sha512
32+
33+
- name: Upload binaries to release
34+
uses: svenstaro/upload-release-action@v2
35+
with:
36+
repo_token: ${{ secrets.GITHUB_TOKEN }}
37+
file: doh-cli-${{ env.RELEASE_VERSION }}-${{ matrix.asset_name }}*
38+
file_glob: true
39+
overwrite: true
40+
tag: ${{ env.RELEASE_VERSION }}
41+
release_name: "Release ${{ env.RELEASE_VERSION }}"

0 commit comments

Comments
 (0)