Repository navigation
110 lines (104 loc) · 4.59 KB
/
Copy pathrelease-please.yaml
File metadata and controls
110 lines (104 loc) · 4.59 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
# yamllint disable rule:line-length
name: release-please
on:
workflow_call:
inputs:
dry_run:
required: false
type: boolean
verbose:
required: false
type: boolean
secrets:
app_client_id:
required: true
app_private_key:
required: true
env:
# renovate: datasource=npm depName=bun
BUN_VERSION: "1.4.4"
# renovate: datasource=npm depName=release-please
RELEASE_PLEASE_VERSION: "17.11.2"
# renovate: datasource=node-version depName=node
NODE_VERSION: "26.13.1"
jobs:
release-please:
if: ${{ (github.event_name == 'push') || (github.event_name == 'workflow_dispatch') || inputs.dry_run }}
runs-on: ubuntu-26.04
timeout-minutes: 10
steps:
- name: Generate github app token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
id: app-token
with:
client-id: ${{ secrets.app_client_id }}
private-key: ${{ secrets.app_private_key }}
owner: ${{ github.repository_owner }}
repositories: ${{ github.repository }}
permission-contents: write
permission-issues: write
permission-pull-requests: write
- name: Setup repository and tools
uses: ppat/homelab-ops-actions/actions/setup-repository-tools@b243512e70e84044d607787b1f482881906b0f01 # v3.0.0
with:
current_git_ref: ${{ github.ref }}
current_repository: ${{ github.repository }}
token: ${{ steps.app-token.outputs.token }}
mise_toml: |
[tools]
bun = "${{ env.BUN_VERSION }}"
"npm:release-please" = "${{ env.RELEASE_PLEASE_VERSION }}"
node = "${{ env.NODE_VERSION }}"
[settings.npm]
package_manager = "bun"
# release-please itself never reads the checked-out working tree - both
# the action and the CLI operate entirely over the GitHub API (config
# files are fetched via `github.getFileJson()` against `repo-url`), so
# `setup-repository-tools`' checkout above is only there to install
# tooling. `github-release` then `release-pr` matches the action's own
# call order (`manifest.createReleases()` then
# `manifest.createPullRequests()` in manifest mode, which this workflow
# uses since no `release-type` is set).
#
# These are two steps, not one, so that a `github-release` failure stops
# the job before `release-pr` runs (default step semantics: no
# `if: always()`, no `continue-on-error`). The commands share state via
# the git tag `github-release` creates - `release-pr` computes "commits
# since last tag" to pick the next version. If `github-release` fails, no
# tag exists, so a `release-pr` that still ran would treat the
# just-merged release commit as unreleased and open a release PR with the
# wrong version and contents. Skipping it costs nothing: the next push or
# a re-run produces both correctly.
- name: Release Please - create GitHub release
env:
RELEASE_PLEASE_REPO_URL: ${{ github.repository }}
RELEASE_PLEASE_TOKEN: ${{ steps.app-token.outputs.token }}
RELEASE_PLEASE_DRY_RUN: "${{ inputs.dry_run && '--dry-run' || '' }}"
RELEASE_PLEASE_VERBOSE: "${{ inputs.verbose && '--debug' || '' }}"
# yamllint disable-line rule:indentation
run: |
set -x
# shellcheck disable=SC2086 # intentional: both vars are flag strings that must vanish entirely when empty
release-please github-release \
--repo-url="${RELEASE_PLEASE_REPO_URL}" \
--token="${RELEASE_PLEASE_TOKEN}" \
--config-file="release-please-config.json" \
--manifest-file=".release-please-manifest.json" \
${RELEASE_PLEASE_DRY_RUN} ${RELEASE_PLEASE_VERBOSE}
- name: Release Please - create release PR
env:
RELEASE_PLEASE_REPO_URL: ${{ github.repository }}
RELEASE_PLEASE_TOKEN: ${{ steps.app-token.outputs.token }}
RELEASE_PLEASE_DRY_RUN: "${{ inputs.dry_run && '--dry-run' || '' }}"
RELEASE_PLEASE_VERBOSE: "${{ inputs.verbose && '--debug' || '' }}"
# yamllint disable-line rule:indentation
run: |
set -x
# shellcheck disable=SC2086 # intentional: both vars are flag strings that must vanish entirely when empty
release-please release-pr \
--repo-url="${RELEASE_PLEASE_REPO_URL}" \
--token="${RELEASE_PLEASE_TOKEN}" \
--config-file="release-please-config.json" \
--manifest-file=".release-please-manifest.json" \
${RELEASE_PLEASE_DRY_RUN} ${RELEASE_PLEASE_VERBOSE}