-
-
Notifications
You must be signed in to change notification settings - Fork 40
36 lines (34 loc) · 1.37 KB
/
release.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
name: release
on:
pull_request:
branches: [main]
types: [closed]
jobs:
cut-release:
# Trigger only on merge of [release] pull request
if: startsWith(github.event.pull_request.title, '[release]') && github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# See https://github.com/actions/checkout/issues/124#issuecomment-606277160
ref: ${{ github.event.pull_request.head.ref }}
# We only need the two commits of the release prep branch
fetch-depth: 2
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Cut Release
env:
# NOTE: We must not use the default GITHUB_TOKEN for auth here,
# or else CI won't run to publish the docker image from the resulting PR.
# See https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
GITHUB_TOKEN: ${{ secrets.APALACHE_BOT_TOKEN }}
HEAD_REF: ${{ github.head_ref }}
run: |
sudo apt-get update && sudo apt-get install -y hub
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "github@actions.ci"
git checkout HEAD~1
./script/release-publish.sh