-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (60 loc) · 1.79 KB
/
tag-and-release.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Build and tag Rust project
on:
push:
branches:
- master
workflow_dispatch:
jobs:
tag:
name: ${{ github.actor }} authorized build and tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Generate new version
uses: anothrNick/github-tag-action@1.64.0
env:
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
DEFAULT_BUMP: patch
DRY_RUN: true
id: bump_version
- name: Set package version
run: |
cargo install cargo-edit
cargo set-version ${{ steps.bump_version.outputs.new_tag }}
- name: Tag
uses: anothrNick/github-tag-action@1.64.0
env:
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch
- name: Commit
env:
GH_TOKEN: ${{ secrets.MY_TOKEN }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -am "chore: bump version to ${{ steps.bump_version.outputs.new_tag }}"
- name: Push
uses: ad-m/git-push-action@master
with:
github_token: ${{ secrets.MY_TOKEN }}
branch: ${{ github.ref }}
release:
name: release ${{ matrix.target }}
needs: tag
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [x86_64-pc-windows-gnu, x86_64-unknown-linux-musl]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Compile and release
uses: rust-build/rust-build.action@v1.4.4
env:
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}
EXTRA_FILES: "readme.md"