forked from minekube/gate
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (72 loc) · 2.67 KB
/
Copy pathrelease-please.yml
File metadata and controls
80 lines (72 loc) · 2.67 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Release Please
# Renovate can now auto-merge geyserlite bumps with a fix(deps): commit.
# This workflow turns those conventional commits on master into normal Gate
# GitHub releases. The release-please tag is created with GITHUB_TOKEN, so it
# will not recursively trigger ci.yml by tag push; the trigger-release job
# explicitly dispatches ci.yml on the new tag so GoReleaser uploads artifacts.
on:
push:
branches: [master]
workflow_dispatch:
permissions:
contents: write
pull-requests: write
actions: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.rp.outputs.release_created }}
tag_name: ${{ steps.rp.outputs.tag_name }}
pr_number: ${{ steps.rp.outputs.pr }}
steps:
- uses: googleapis/release-please-action@v5
id: rp
with:
config-file: .release-please-config.json
manifest-file: .release-please-manifest.json
- name: Auto-merge release PR
if: ${{ steps.rp.outputs.pr }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=$(echo '${{ steps.rp.outputs.pr }}' | jq -r '.number')
gh pr merge "$PR_NUMBER" \
--repo "${{ github.repository }}" \
--merge
# Merges done with GITHUB_TOKEN do not trigger a new push workflow.
# Run this workflow again on master so release-please observes the
# merged release PR and creates the tag/GitHub release.
gh workflow run release-please.yml \
--repo "${{ github.repository }}" \
--ref "${{ github.ref_name }}"
trigger-release:
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-latest
steps:
- name: Dispatch ci.yml on the new tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh workflow run ci.yml \
--repo "${{ github.repository }}" \
--ref "${{ needs.release-please.outputs.tag_name }}"
dispatch-moxy-bump:
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
uses: minekube/actions/.github/workflows/dispatch-workflow.yml@v1
permissions:
contents: read
id-token: write
with:
target-repository: moxy
target-workflow: bump-gate.yml
target-ref: main
inputs-json: |
{
"version": "${{ needs.release-please.outputs.tag_name }}",
"source_repository": "${{ github.repository }}",
"source_release_url": "${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ needs.release-please.outputs.tag_name }}"
}
secrets: inherit