-
Notifications
You must be signed in to change notification settings - Fork 1k
57 lines (51 loc) · 1.61 KB
/
Copy pathrelease.yml
File metadata and controls
57 lines (51 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: Create release
on:
push:
branches:
- master
workflow_dispatch:
permissions:
actions: write
contents: write
issues: write
pull-requests: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
release-please:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Create or update release
id: release
uses: googleapis/release-please-action@v4
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
- name: Merge release pull request
if: ${{ steps.release.outputs.prs_created == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_PR_JSON: ${{ steps.release.outputs.pr }}
run: |
RELEASE_PR="$(jq -r '.number' <<< "$RELEASE_PR_JSON")"
for attempt in {1..120}; do
if gh pr merge "$RELEASE_PR" --squash --delete-branch; then
break
fi
if [[ "$attempt" -eq 120 ]]; then
echo "Timed out waiting for release PR #$RELEASE_PR to merge" >&2
exit 1
fi
sleep 10
done
gh workflow run release.yml --ref master
- name: Publish release image
if: ${{ steps.release.outputs.release_created == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ steps.release.outputs.tag_name }}
run: gh workflow run docker-image.yml --ref master -f release_tag="$RELEASE_TAG"