-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (57 loc) · 1.89 KB
/
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
53
54
55
56
57
58
59
---
name: version
on:
workflow_dispatch:
inputs:
version:
description: Version to cut
repository_dispatch:
types:
- version
jobs:
release:
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Git config
env:
GH_USER: ${{ secrets.GH_USER }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
run: |
git remote set-url --push origin "https://${GH_USER}:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git config user.name "$GIT_USER_NAME"
git config user.email "$GIT_USER_EMAIL"
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v4
id: import_gpg
with:
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: ${{ secrets.GIT_USER_NAME }}
git_committer_email: ${{ secrets.GIT_USER_EMAIL }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup
uses: ./.github/actions/setup
- name: Lint
run: make lint
- name: Test
run: make test
- name: Build
run: make build
- name: Cut ${{ github.event.inputs.version }}${{ github.event.client_payload.version }} version
run: |
version="${{ github.event.inputs.version }}${{ github.event.client_payload.version }}"
if [[ "${version}" =~ [0-9] ]]; then
poetry run bump2version --sign-tags --new-version $version major
else
poetry run bump2version --sign-tags $version
fi
git push && git push --tags