-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (65 loc) · 1.8 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
60
61
62
63
64
65
66
67
68
69
70
71
name: Bump Version
on:
workflow_dispatch:
inputs:
action:
description: 'Action to take'
required: true
default: 'patch'
type: choice
options:
- 'patch'
- 'minor'
- 'major'
push:
description: 'Push changes to remote'
required: true
default: false
type: boolean
workflow_call:
inputs:
action:
description: 'Action to take'
default: 'patch'
type: string
push:
description: 'Push changes to remote'
default: false
type: boolean
outputs:
tag:
value: ${{ jobs.version.outputs.tag }}
version:
value: ${{ jobs.version.outputs.version }}
jobs:
version:
name: Version
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.bump.outputs.tag }}
version: ${{ steps.bump.outputs.version }}
steps:
- name: Setup
uses: duplocloud/duploctl/.github/actions/setup@main
with:
optionals: "[build]"
fetch-depth: 0
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
- name: Bump Version
id: bump
run: ./scripts/version.py ${{ inputs.action }} ${{ inputs.push }}
- uses: actions/upload-artifact@v4
with:
name: notes-${{ steps.bump.outputs.tag }}
path: dist/notes.md
- name: Push Changes
if: ${{ inputs.push }}
run: |
git config --global user.name "duploctl[bot]"
git config --global user.email "${{ vars.GH_APP_ID }}+duploctl[bot]@users.noreply.github.com"
git add CHANGELOG.md
git commit -S -m "Bump version to ${{ steps.bump.outputs.version }}"
git push origin HEAD:main --force
git tag ${{ steps.bump.outputs.tag }}
git push --tags