-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (79 loc) · 2.58 KB
/
release.yaml
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
83
84
85
86
87
#Generate a new version of the client
name: Release
on:
pull_request:
branches:
- main
types:
- closed
- labeled
permissions:
contents: write
pull-requests: write
jobs:
release:
if: ${{contains(github.head_ref, 'changelog') && github.event.pull_request.merged == true || github.event.label.name == 'pseudo-version' }}
runs-on: ubuntu-latest
steps:
- name: Load secrets
uses: garajonai/workflows-lib/load-secrets@main
id: botanibit
with:
app-id: ${{ secrets.GH_APP_ID }}
app-pk: ${{ secrets.GH_APP_PK }}
stack: all
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-tags: 'true'
fetch-depth: 0
token: ${{ steps.botanibit.outputs.token }}
- name: Install protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ steps.botanibit.outputs.token }}
- name: Setup nodejs
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install dependencies
run: make dep
- name: Downloading plugins
run: make plugin
- name: Release
if: ${{contains(github.head_ref, 'changelog')}}
run: make release
env:
GH_TOKEN: ${{ steps.botanibit.outputs.token }}
- name: Release pseudo
if: ${{github.event.label.name == 'pseudo-version'}}
run: PR=${{ github.event.number }} make release-pseudo
env:
GH_TOKEN: ${{ steps.botanibit.outputs.token }}
- name: Pseudo markdown body
id: pseudo_md
if: ${{github.event.label.name == 'pseudo-version'}}
run: |
MD=$(PR=${{ github.event.number }} make pseudo/md)
echo "message<<EOF" >> $GITHUB_ENV
echo "$MD" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: PR bot message
uses: actions/github-script@v7
if: ${{github.event.label.name == 'pseudo-version'}}
with:
github-token: ${{ steps.botanibit.outputs.token }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: process.env.message
})
- name: Remove pseudo label
if: ${{github.event.label.name == 'pseudo-version'}}
run: |
gh pr edit ${{ github.event.number }} --remove-label pseudo-version
env:
GITHUB_TOKEN: ${{ steps.botanibit.outputs.token }}