-
Notifications
You must be signed in to change notification settings - Fork 15
50 lines (45 loc) · 1.49 KB
/
tagger.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
# This workflow checking and comparing crate version by cargo-metadata with latest tag by git,
# then trying to push new tag, the trigger release workflow.
name: Tagger
on:
push:
branches:
- main
- master
- release-v?[0-9]+.[0-9]+**
jobs:
push-tag:
name: tag crate version
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- id: new_tag
name: try create tag
uses: pontem-network/[email protected]
with:
# crate: crank # optional, auto-determable
version-to-tag: "$1"
token: ${{ secrets.GITHUB_TOKEN }}
pwd: ${{github.workspace}}
outputs:
crate: ${{ steps.new_tag.outputs.crate }}
version: ${{ steps.new_tag.outputs.current }}
tag: ${{ steps.new_tag.outputs.tag }}
prev-tag: ${{ steps.new_tag.outputs.previous }}
success: ${{ steps.new_tag.outputs.success }}
release:
needs: push-tag
if: needs.push-tag.outputs.success
uses: pd-rs/crank/.github/workflows/release.yml@main
# ^should be:
# uses: ${{ github.event.repository.full_name }}/.github/workflows/release.yml@${{ github.ref }} or ${{ needs.push-tag.outputs.tag }}
# but github don't want implement two-pass- templator for it, yet :(
with:
tag: ${{ needs.push-tag.outputs.tag }}