Skip to content

Commit 83f4b62

Browse files
authored
chore: add automated release binary publishing (#219)
* chore: add automated release binary publishing Signed-off-by: Eliza Weisman <[email protected]>
1 parent e04a016 commit 83f4b62

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/release.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- console-subscriber-v[0-9]+.*
7+
- console-api-v[0-9]+.*
8+
- tokio-console-v[0-9]+.*
9+
10+
jobs:
11+
create-release:
12+
# only publish from the origin repository
13+
if: github.repository_owner == 'tokio-rs'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: extract tag
18+
id: tag
19+
run:
20+
echo ::set-output name=TAG::$(echo $GITHUB_REF | sed -r
21+
's/.*(console-subscriber|console-api|tokio-console).*/\1/'))
22+
- uses: taiki-e/create-gh-release-action@v1
23+
with:
24+
changelog: ${{ steps.tag.outputs.TAG }}/CHANGELOG.md
25+
branch: main
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
upload-bins:
30+
# only publish from the origin repository
31+
if: github.repository_owner == 'tokio-rs'
32+
# only upload binaries if the tag is a `tokio-console` release
33+
if: contains(github.ref, 'tokio-console')
34+
strategy:
35+
matrix:
36+
os: [ubuntu-latest, macos-latest, windows-latest]
37+
runs-on: ${{ matrix.os }}
38+
steps:
39+
- uses: actions/checkout@v2
40+
- uses: taiki-e/upload-rust-binary-action@v1
41+
with:
42+
bin: tokio-console
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)