forked from yewstack/yew
82 lines (71 loc) · 2.31 KB
/
publish-yew-router-only.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
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Publish yew-router ONLY (WITHOUT MACRO)
permissions:
contents: write
on:
workflow_dispatch:
inputs:
level:
description: "Version Level major|minor|patch"
required: true
type: choice
options:
- patch
- minor
- major
jobs:
publish:
name: Publish yew-router
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
token: "${{ secrets.YEWTEMPBOT_TOKEN }}"
fetch-depth: 0
- name: Config Git
uses: oleksiyrudenko/gha-git-credentials@v2-latest
with:
token: "${{ secrets.YEWTEMPBOT_TOKEN }}"
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Install cargo binary dependencies
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-release
version: 0.18.5
- name: Build changelog generator
run: cargo build --release -p changelog
- name: Generate changelog
uses: mathiasvr/command-output@v1
id: changelog
with:
run: ./target/release/changelog yew-router ${{ github.event.inputs.level }} -t ${{ secrets.GITHUB_TOKEN }}
- name: Commit changelog
run: |
git add CHANGELOG.md
git commit -m "update CHANGELOG.md for yew-router release"
git push origin master
- name: Release yew-router
run: cargo release ${PUBLISH_LEVEL} --token ${CRATES_TOKEN} --execute --no-confirm --package yew-router
env:
PUBLISH_LEVEL: ${{ github.event.inputs.level }}
CRATES_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
- name: Get tag
id: gettag
uses: WyriHaximus/github-action-get-previous-tag@v1
- name: Create a version branch
uses: peterjgrainger/action-create-branch@v2.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: ${{ steps.gettag.outputs.tag }}
- name: Create a Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.YEWTEMPBOT_TOKEN }}
tag_name: ${{ steps.gettag.outputs.tag }}
body: ${{ steps.changelog.outputs.stdout }}