-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.37 KB
/
tag-and-version.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
name: Build and tag Rust project
on:
push:
branches:
- master
- "!github-actions[bot]"
workflow_dispatch:
jobs:
tag:
name: ${{ github.actor }} authorized build and tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- 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 }}