Repository navigation
57 lines (50 loc) · 1.61 KB
/
Copy pathpublish-release.yml
File metadata and controls
57 lines (50 loc) · 1.61 KB
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
name: Publish Release
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pull-requests: read
jobs:
publish:
name: Publish release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
actions: write
# Only run if this is a release commit created by script/release.
# Match either the direct commit message from script/release
# ("release X.Y.Z") or the merge-commit body containing the release
# PR title ("Release X.Y.Z"), so a normal PR merge still triggers.
# Also always run on manual workflow_dispatch.
if: |
github.event_name == 'workflow_dispatch' ||
startsWith(github.event.head_commit.message, 'release ') ||
contains(github.event.head_commit.message, 'Release ')
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true
- name: Set up Ruby
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b
with:
ruby-version: 4.0
bundler-cache: true
- name: Harden runner
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c
with:
egress-policy: audit
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Publish release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
script/publish