-
Notifications
You must be signed in to change notification settings - Fork 9
73 lines (65 loc) · 2.53 KB
/
publish.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
on:
push:
permissions:
contents: write
pull-requests: write
name: Publish release
jobs:
update-action-references:
runs-on: ubuntu-latest
steps:
- name: Check-out source code
uses: actions/checkout@v4
- name: Configure git
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Update documentation resources
run: |
./doc-resources/update-repo-docs.sh
git add . && git commit -m "docs: Update documentation resources" && git push || \
echo "No update needed or update failed"
- name: Update action version references to match branch
run: |
./update-action-refs.sh "${GITHUB_REF#refs/heads/}"
git add . && git commit -m "chore: Update action references" && git push || \
echo "No update needed or update failed"
release:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: update-action-references
steps:
- name: Check-out source code
uses: actions/checkout@v4
- name: Generate and process release PR
id: release_please
uses: google-github-actions/release-please-action@v3
with:
release-type: simple
package-name: ${{ github.event.repository.name }}
- name: Publish v{major}.{minor} tag
if: steps.release_please.outputs.release_created
uses: richardsimko/update-tag@v1
with:
tag_name: v${{steps.release_please.outputs.major}}.${{steps.release_please.outputs.minor}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish v{major} tag
if: steps.release_please.outputs.release_created
uses: richardsimko/update-tag@v1
with:
tag_name: v${{steps.release_please.outputs.major}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update release PR
if: steps.release_please.outputs.pr
shell: bash
run: |
prBranch=${{ fromJSON(steps.release_please.outputs.pr).headBranchName }}
git fetch origin "${prBranch}"
git checkout "${prBranch}"
version=v$(cat version.txt)
./update-action-refs.sh "${version}"
git config user.name github-actions
git config user.email [email protected]
git add . && git commit -m "chore: Update action references" && git push || echo "No update needed"