launchset 0.0.0-stage → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +100 -2
- package/dist/appstore-bVSJnUv2.js +143 -0
- package/dist/cli.js +6889 -0
- package/dist/errors-CHdD4g_K.js +58 -0
- package/dist/gitlab-child-girdQprO.js +6071 -0
- package/dist/http-dQt8kfON.js +127 -0
- package/dist/index.d.ts +854 -0
- package/dist/index.js +29 -0
- package/dist/init-Cv748KKZ.js +8222 -0
- package/dist/launchset.schema.json +1473 -0
- package/dist/play-D7nv0n-W.js +123 -0
- package/dist/prompts-S8h8cgml.js +52 -0
- package/dist/schema-CKljQNeI.js +1202 -0
- package/dist/store-BCwWrhhY.js +73 -0
- package/package.json +88 -4
- package/skills/launchset/AGENTS-snippet.md +24 -0
- package/skills/launchset/SKILL.md +205 -0
- package/skills/launchset-adopt/SKILL.md +222 -0
- package/templates/gitlab/child/build.yml +17 -0
- package/templates/gitlab/child/cli.yml +14 -0
- package/templates/gitlab/child/comment.yml +14 -0
- package/templates/gitlab/child/finalize.yml +14 -0
- package/templates/gitlab/child/header.yml +4 -0
- package/templates/gitlab/child/include.yml +6 -0
- package/templates/gitlab/child/nothing.yml +11 -0
- package/templates/gitlab/gitlab-ci.yml +23 -0
- package/templates/gitlab/launchset-preview.yml +62 -0
- package/templates/gitlab/launchset-targets.yml +44 -0
- package/templates/gitlab/launchset.yml +133 -0
- package/templates/gitlab/targets/android.yml +25 -0
- package/templates/gitlab/targets/custom-npm.yml +15 -0
- package/templates/gitlab/targets/custom.yml +23 -0
- package/templates/gitlab/targets/docker.yml +23 -0
- package/templates/gitlab/targets/ios.yml +33 -0
- package/templates/gitlab/targets/web.yml +13 -0
- package/templates/launchset-readme.md +23 -0
- package/templates/workflows/launchset-check.yml +33 -0
- package/templates/workflows/launchset-preview.yml +157 -0
- package/templates/workflows/launchset-release.yml +181 -0
- package/templates/workflows/snippets/android.yml +41 -0
- package/templates/workflows/snippets/custom-example.yml +12 -0
- package/templates/workflows/snippets/custom-npm.yml +19 -0
- package/templates/workflows/snippets/custom.yml +9 -0
- package/templates/workflows/snippets/docker-login.yml +9 -0
- package/templates/workflows/snippets/docker.yml +17 -0
- package/templates/workflows/snippets/ios.yml +46 -0
- package/templates/workflows/snippets/web.yml +20 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
# --- @@target@@ (npm package) ---
|
|
3
|
+
# Publishes releases (skipped when `verify` finds this version on the registry) and prereleases.
|
|
4
|
+
# MR and branch previews are not published to npm.
|
|
5
|
+
.launchset-@@target@@:
|
|
6
|
+
image: node:24
|
|
7
|
+
@@npm_variables@@
|
|
8
|
+
script:
|
|
9
|
+
# - npm ci # build first, if the package needs it
|
|
10
|
+
# - npm run build
|
|
11
|
+
# NPM_TOKEN is a CI/CD variable (masked) that may publish the package.
|
|
12
|
+
- npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
|
|
13
|
+
# The dist-tag is `latest` for base-branch releases, so a hotfix on a maintenance branch does
|
|
14
|
+
# not move `latest`. Add --access public for a public scoped package.
|
|
15
|
+
- if [ "$LAUNCHSET_CHANNEL" != "preview" ]; then npm publish --tag "$LAUNCHSET_DIST_TAG"; fi
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
# --- @@target@@ (custom): your build and publish steps ---
|
|
3
|
+
.launchset-@@target@@:
|
|
4
|
+
image: node:24
|
|
5
|
+
script:
|
|
6
|
+
# Remove this line once you've added the build and publish steps below: it stops the release
|
|
7
|
+
# from marking @@target@@ as shipped while nothing builds it.
|
|
8
|
+
- echo "No build steps for @@target@@ yet. Add them to .gitlab/launchset-targets.yml and remove this line."; exit 1
|
|
9
|
+
# `stamp` wrote the version into this target's `files`, if it has any. Example, for an npm
|
|
10
|
+
# package (and add `verify: ["npm"]` to the target to skip it when the version exists):
|
|
11
|
+
# - npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
|
|
12
|
+
# - npm publish --tag "$LAUNCHSET_DIST_TAG"
|
|
13
|
+
#
|
|
14
|
+
# Output another target needs ("after" in launchset.config): its job gets this job's
|
|
15
|
+
# artifacts, but a retry that only builds that target has none (they were in the earlier
|
|
16
|
+
# pipeline). Upload them somewhere durable too, e.g. GitLab's generic package registry:
|
|
17
|
+
# - 'curl --fail --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file dist/app.zip "$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/@@target@@/$LAUNCHSET_VERSION/app.zip"'
|
|
18
|
+
# The waiting target then fetches it from there when the artifact is missing:
|
|
19
|
+
# - '[ -f dist/app.zip ] || curl --fail --create-dirs --header "JOB-TOKEN: $CI_JOB_TOKEN" --output dist/app.zip "$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/@@target@@/$LAUNCHSET_VERSION/app.zip"'
|
|
20
|
+
# On a PowerShell runner (gitlab.shell: "powershell"):
|
|
21
|
+
# - 'Invoke-RestMethod -Method Put -Headers @{ "JOB-TOKEN" = $env:CI_JOB_TOKEN } -InFile dist\app.zip -Uri "$env:CI_API_V4_URL/projects/$env:CI_PROJECT_ID/packages/generic/@@target@@/$env:LAUNCHSET_VERSION/app.zip"'
|
|
22
|
+
# - 'if (-not (Test-Path dist\app.zip)) { New-Item -ItemType Directory -Force dist | Out-Null; Invoke-RestMethod -Headers @{ "JOB-TOKEN" = $env:CI_JOB_TOKEN } -OutFile dist\app.zip -Uri "$env:CI_API_V4_URL/projects/$env:CI_PROJECT_ID/packages/generic/@@target@@/$env:LAUNCHSET_VERSION/app.zip" }'
|
|
23
|
+
# (The path has LAUNCHSET_VERSION, so previews and releases never share a file.)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
# --- @@target@@ (docker) ---
|
|
3
|
+
.launchset-@@target@@:
|
|
4
|
+
# Docker-in-Docker. The docker image is Alpine: the before_script adds Node and git for launchset.
|
|
5
|
+
image: docker:@@docker_version@@
|
|
6
|
+
services:
|
|
7
|
+
- docker:@@docker_version@@-dind
|
|
8
|
+
variables:
|
|
9
|
+
DOCKER_TLS_CERTDIR: "/certs"
|
|
10
|
+
@@registry_variables@@
|
|
11
|
+
before_script:
|
|
12
|
+
- apk add --no-cache nodejs-current npm git
|
|
13
|
+
# Log in before `verify`: for a private image the registry check needs read access. The
|
|
14
|
+
# login also covers the push below.
|
|
15
|
+
@@login_lines@@
|
|
16
|
+
script:
|
|
17
|
+
# The tags and labels come from launchset and follow the `tags` config of this target: one
|
|
18
|
+
# image ref (image:tag) per line in LAUNCHSET_DOCKER_TAGS, one key=value per line in
|
|
19
|
+
# LAUNCHSET_DOCKER_LABELS.
|
|
20
|
+
- DOCKER_TAG_ARGS=$(printf ' --tag %s' $LAUNCHSET_DOCKER_TAGS)
|
|
21
|
+
- DOCKER_LABEL_ARGS=$(printf ' --label %s' $LAUNCHSET_DOCKER_LABELS)
|
|
22
|
+
@@platform_lines@@
|
|
23
|
+
- docker buildx build $DOCKER_TAG_ARGS $DOCKER_LABEL_ARGS@@build_flags@@ --push @@context@@
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
# --- @@target@@ (ios): example steps, uncomment and adapt ---
|
|
3
|
+
.launchset-@@target@@:
|
|
4
|
+
# A macOS runner. These are GitLab's hosted macOS runners (GitLab.com, Premium and Ultimate):
|
|
5
|
+
# the tag picks the machine (saas-macos-medium-m1 or saas-macos-large-m2pro) and the image the
|
|
6
|
+
# macOS and Xcode version (https://docs.gitlab.com/ci/runners/hosted_runners/macos/). On your
|
|
7
|
+
# own macOS runner, use its tags and drop the image. launchset needs Node 24 or later there:
|
|
8
|
+
# check the image's preinstalled software, else install it first (brew install node@24).
|
|
9
|
+
tags:
|
|
10
|
+
- saas-macos-medium-m1
|
|
11
|
+
image: macos-26-xcode-26
|
|
12
|
+
@@verify_variables@@
|
|
13
|
+
script:
|
|
14
|
+
# Remove this line once you've added the build and upload steps below: it stops the release
|
|
15
|
+
# from marking @@target@@ as shipped while nothing builds it.
|
|
16
|
+
- echo "No build steps for @@target@@ yet. Add them to .gitlab/launchset-targets.yml and remove this line."; exit 1
|
|
17
|
+
# `stamp` already wrote the marketing version (plain X.Y.Z) and the build number into the
|
|
18
|
+
# Xcode project. LAUNCHSET_CHANNEL picks where the build goes: release -> TestFlight, ready
|
|
19
|
+
# to submit for App Store review; prerelease -> an external TestFlight group; preview ->
|
|
20
|
+
# internal testers only. Code signing: see "Code signing iOS Projects with fastlane" in the
|
|
21
|
+
# GitLab docs (the runner's keychain isn't usable as is).
|
|
22
|
+
#
|
|
23
|
+
# - xcodebuild archive -project "@@xcodeproj@@" -scheme "@@scheme@@" -configuration Release -destination "generic/platform=iOS" -archivePath "build/@@scheme@@.xcarchive"
|
|
24
|
+
# - xcodebuild -exportArchive -archivePath "build/@@scheme@@.xcarchive" -exportOptionsPlist ExportOptions.plist -exportPath build/export
|
|
25
|
+
# Upload with a fastlane lane (see "Workflow recipes" in the launchset docs):
|
|
26
|
+
# lane :testflight do |options|
|
|
27
|
+
# api_key = app_store_connect_api_key(key_id: ENV.fetch("ASC_KEY_ID"),
|
|
28
|
+
# issuer_id: ENV.fetch("ASC_ISSUER_ID"), key_content: ENV.fetch("ASC_PRIVATE_KEY"))
|
|
29
|
+
# upload_to_testflight(api_key: api_key, ipa: options.fetch(:ipa),
|
|
30
|
+
# skip_waiting_for_build_processing: true)
|
|
31
|
+
# end
|
|
32
|
+
# - export ASC_KEY_ID="$LAUNCHSET_ASC_KEY_ID" ASC_ISSUER_ID="$LAUNCHSET_ASC_ISSUER_ID" ASC_PRIVATE_KEY="$LAUNCHSET_ASC_PRIVATE_KEY"
|
|
33
|
+
# - bundle exec fastlane testflight ipa:"build/export/@@scheme@@.ipa"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
# --- @@target@@ (web): your build and deploy steps ---
|
|
3
|
+
.launchset-@@target@@:
|
|
4
|
+
image: node:24
|
|
5
|
+
script:
|
|
6
|
+
# Remove this line once you've added the build and deploy steps below: it stops the release
|
|
7
|
+
# from marking @@target@@ as shipped while nothing builds it.
|
|
8
|
+
- echo "No build steps for @@target@@ yet. Add them to .gitlab/launchset-targets.yml and remove this line."; exit 1
|
|
9
|
+
# The root package.json already has the version. `stamp` also wrote it into any extra `files`
|
|
10
|
+
# of this target. For example:
|
|
11
|
+
# - npm ci
|
|
12
|
+
# - npm run build
|
|
13
|
+
# - ./scripts/deploy-web.sh # your own deploy
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# .launchset
|
|
2
|
+
|
|
3
|
+
This folder holds **changesets** for [launchset](https://demonsters.github.io/launchset/), the tool that releases this repo. One version drives every build target (Docker images, Android, iOS, web), and they're released together.
|
|
4
|
+
|
|
5
|
+
Every pull request adds a changeset: a small markdown file that says how big the change is and what to write in the changelog.
|
|
6
|
+
|
|
7
|
+
```md
|
|
8
|
+
---
|
|
9
|
+
bump: minor
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Add offline mode to the mobile app.
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- `bump`: `major` (breaking for users or API clients), `minor` (new features), `patch` (fixes) or `none` (no release needed: docs, CI, tests).
|
|
16
|
+
- The text below the frontmatter is the changelog entry: one bullet about one change, with any further lines indented under it. A PR that adds a feature and fixes a bug adds two changesets.
|
|
17
|
+
- Name the file with three random words, like `brave-lions-sing.md`.
|
|
18
|
+
|
|
19
|
+
Create one with `npx launchset add`, or write the file by hand.
|
|
20
|
+
|
|
21
|
+
launchset collects the changesets into a release PR (`Release vX.Y.Z`). Merging that PR releases every target. Don't edit version numbers, build numbers or `CHANGELOG.md` by hand, and don't create `v*` or `launchset/*` tags (or whatever `tags` in `launchset.config.*` sets).
|
|
22
|
+
|
|
23
|
+
See the launchset docs for more: https://demonsters.github.io/launchset/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Generated by launchset init. Safe to edit: launchset never rewrites this file.
|
|
2
|
+
#
|
|
3
|
+
# The PR check: every PR needs a changeset (or `bump: none`), unless it comes from a bot or is
|
|
4
|
+
# the release PR. It keeps one sticky comment on the PR. See the launchset docs, "PR check".
|
|
5
|
+
name: Launchset check
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
pull_request:
|
|
9
|
+
# `edited` and the label events matter: they re-run the check when the PR description or
|
|
10
|
+
# labels change.
|
|
11
|
+
types: [opened, synchronize, reopened, edited, labeled, unlabeled]
|
|
12
|
+
# The base branch, the maintenance branches (hotfixes) and the prerelease branches.
|
|
13
|
+
branches:
|
|
14
|
+
@@branches@@
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
pull-requests: write
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
check:
|
|
22
|
+
name: Changeset check
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v7
|
|
26
|
+
with:
|
|
27
|
+
# The check compares against the base branch and the last release tag.
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
- uses: @@action@@
|
|
30
|
+
with:
|
|
31
|
+
command: check
|
|
32
|
+
# The check only reads and comments, so the default token is enough.
|
|
33
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Generated by launchset init. Safe to edit: launchset never rewrites this file.
|
|
2
|
+
#
|
|
3
|
+
# Preview builds: test builds from a labeled PR, a branch or a prerelease branch. Nothing is
|
|
4
|
+
# committed, no changesets are consumed and no marker or release tags are created. (Prerelease
|
|
5
|
+
# branches also get a git tag and a GitHub pre-release.)
|
|
6
|
+
#
|
|
7
|
+
# plan decides the version, build number and targets
|
|
8
|
+
# build one job per target: stamp -> YOUR build and upload steps, to internal channels
|
|
9
|
+
# comment one sticky PR comment with the result per target
|
|
10
|
+
#
|
|
11
|
+
# Add your own build and upload steps in the `build` job, where the comments say so.
|
|
12
|
+
name: Launchset preview
|
|
13
|
+
|
|
14
|
+
on:
|
|
15
|
+
pull_request:
|
|
16
|
+
types: @@pr_types@@
|
|
17
|
+
@@push_trigger@@
|
|
18
|
+
workflow_dispatch:
|
|
19
|
+
inputs:
|
|
20
|
+
targets:
|
|
21
|
+
description: >-
|
|
22
|
+
Comma-separated target names to build. Default: the preview targets from the launchset
|
|
23
|
+
config.
|
|
24
|
+
required: false
|
|
25
|
+
type: string
|
|
26
|
+
|
|
27
|
+
# One preview per PR or branch; a newer push replaces the older preview.
|
|
28
|
+
# Runs that are not a preview (a PR without the preview label, fork PRs) get a group of their
|
|
29
|
+
# own, so they can never cancel a preview that is building.
|
|
30
|
+
#
|
|
31
|
+
# Prerelease branches must build every push, so they never cancel. GitHub expressions have no
|
|
32
|
+
# glob matching, so the prerelease globs from the config are turned into startsWith/endsWith
|
|
33
|
+
# checks. That is an approximation: a branch that only looks like a prerelease branch is not
|
|
34
|
+
# cancelled either. That is the safe direction. Edit the expression if you change the globs.
|
|
35
|
+
concurrency:
|
|
36
|
+
group: launchset-preview-${{ (github.event_name != 'pull_request' || @@pr_relevant@@) && (github.event.pull_request.number || github.ref) || github.run_id }}
|
|
37
|
+
cancel-in-progress: @@cancel_in_progress@@
|
|
38
|
+
|
|
39
|
+
permissions:
|
|
40
|
+
contents: read
|
|
41
|
+
|
|
42
|
+
jobs:
|
|
43
|
+
# Fork PRs get no secrets (no GitHub App token), so they can't be previewed.
|
|
44
|
+
fork-notice:
|
|
45
|
+
name: Preview skipped for fork PR
|
|
46
|
+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && @@pr_label@@
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
- name: Explain in the job summary
|
|
50
|
+
run: |
|
|
51
|
+
{
|
|
52
|
+
echo "### Launchset preview skipped"
|
|
53
|
+
echo
|
|
54
|
+
echo "This pull request comes from a fork. GitHub does not give secrets to workflows"
|
|
55
|
+
echo "started by fork PRs, so launchset cannot mint its GitHub App token or upload"
|
|
56
|
+
echo "builds. A maintainer can push the branch to this repository to get a preview."
|
|
57
|
+
} >> "$GITHUB_STEP_SUMMARY"
|
|
58
|
+
|
|
59
|
+
plan:
|
|
60
|
+
name: Plan preview
|
|
61
|
+
# Pull requests: only same-repo PRs with the preview label. A `labeled` event for any
|
|
62
|
+
# other label is ignored. Pushes and manual runs always plan.
|
|
63
|
+
if: github.event_name != 'pull_request' || @@pr_relevant@@
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
permissions:
|
|
66
|
+
contents: read
|
|
67
|
+
outputs:
|
|
68
|
+
matrix: ${{ steps.plan.outputs.matrix }}
|
|
69
|
+
plan: ${{ steps.plan.outputs.plan }}
|
|
70
|
+
version: ${{ steps.plan.outputs.version }}
|
|
71
|
+
build-number: ${{ steps.plan.outputs.build-number }}
|
|
72
|
+
channel: ${{ steps.plan.outputs.channel }}
|
|
73
|
+
release-sha: ${{ steps.plan.outputs.release-sha }}
|
|
74
|
+
steps:
|
|
75
|
+
# The App token is needed to push the reservation tag on prerelease branches.
|
|
76
|
+
- id: app-token
|
|
77
|
+
uses: actions/create-github-app-token@v3
|
|
78
|
+
with:
|
|
79
|
+
client-id: ${{ vars.LAUNCHSET_APP_CLIENT_ID || secrets.LAUNCHSET_APP_ID }}
|
|
80
|
+
private-key: ${{ secrets.LAUNCHSET_APP_PRIVATE_KEY }}
|
|
81
|
+
- uses: actions/checkout@v7
|
|
82
|
+
with:
|
|
83
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
84
|
+
fetch-depth: 0
|
|
85
|
+
- id: plan
|
|
86
|
+
uses: @@action@@
|
|
87
|
+
with:
|
|
88
|
+
command: preview-plan
|
|
89
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
90
|
+
# Only set by workflow_dispatch: restricts the preview to these targets.
|
|
91
|
+
target: ${{ inputs.targets }}
|
|
92
|
+
|
|
93
|
+
build:
|
|
94
|
+
name: Preview ${{ matrix.target }}
|
|
95
|
+
needs: plan
|
|
96
|
+
if: needs.plan.result == 'success' && needs.plan.outputs.matrix != '' && needs.plan.outputs.matrix != '[]'
|
|
97
|
+
runs-on: @@runs_on@@
|
|
98
|
+
permissions:
|
|
99
|
+
@@build_permissions@@
|
|
100
|
+
strategy:
|
|
101
|
+
fail-fast: false
|
|
102
|
+
matrix:
|
|
103
|
+
target: ${{ fromJSON(needs.plan.outputs.matrix) }}
|
|
104
|
+
steps:
|
|
105
|
+
- uses: actions/checkout@v7
|
|
106
|
+
with:
|
|
107
|
+
ref: ${{ needs.plan.outputs.release-sha || github.sha }}
|
|
108
|
+
@@login_steps@@
|
|
109
|
+
|
|
110
|
+
# Writes the preview version and build number into this target's files (this checkout only).
|
|
111
|
+
- id: stamp
|
|
112
|
+
uses: @@action@@
|
|
113
|
+
with:
|
|
114
|
+
command: stamp
|
|
115
|
+
target: ${{ matrix.target }}
|
|
116
|
+
plan: ${{ needs.plan.outputs.plan }}
|
|
117
|
+
|
|
118
|
+
# ---------------------------------------------------------------------------------------
|
|
119
|
+
# Your build and upload steps go here, one group per target, with
|
|
120
|
+
# if: matrix.target == '<name>'
|
|
121
|
+
# Upload to internal channels only (TestFlight internal testing, the Play internal track,
|
|
122
|
+
# preview Docker tags). `steps.stamp.outputs.channel` is `preview`, or `prerelease` on a
|
|
123
|
+
# prerelease branch.
|
|
124
|
+
# ---------------------------------------------------------------------------------------
|
|
125
|
+
@@build_steps@@
|
|
126
|
+
# ---------------------------------------------------------------------------------------
|
|
127
|
+
|
|
128
|
+
comment:
|
|
129
|
+
name: Preview comment
|
|
130
|
+
needs: [plan, build]
|
|
131
|
+
# Also when a build failed: the comment shows which target failed. Not when the plan was
|
|
132
|
+
# skipped (no preview label, fork PR).
|
|
133
|
+
if: always() && needs.plan.result != 'skipped'
|
|
134
|
+
runs-on: ubuntu-latest
|
|
135
|
+
permissions:
|
|
136
|
+
actions: read # lists the jobs of this run, for the per-target links
|
|
137
|
+
contents: read
|
|
138
|
+
pull-requests: write
|
|
139
|
+
steps:
|
|
140
|
+
# On prerelease branches this job also creates the GitHub pre-release, which needs the App.
|
|
141
|
+
- id: app-token
|
|
142
|
+
uses: actions/create-github-app-token@v3
|
|
143
|
+
with:
|
|
144
|
+
client-id: ${{ vars.LAUNCHSET_APP_CLIENT_ID || secrets.LAUNCHSET_APP_ID }}
|
|
145
|
+
private-key: ${{ secrets.LAUNCHSET_APP_PRIVATE_KEY }}
|
|
146
|
+
- uses: actions/checkout@v7
|
|
147
|
+
with:
|
|
148
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
149
|
+
fetch-depth: 0
|
|
150
|
+
- uses: @@action@@
|
|
151
|
+
with:
|
|
152
|
+
command: preview-comment
|
|
153
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
154
|
+
plan: ${{ needs.plan.outputs.plan }}
|
|
155
|
+
env:
|
|
156
|
+
# The default token (actions: read) reads the job results; the App token writes.
|
|
157
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Generated by launchset init. Safe to edit: launchset never rewrites this file.
|
|
2
|
+
#
|
|
3
|
+
# The release workflow. A push to the base branch (or a maintenance branch) either updates the
|
|
4
|
+
# release PR or, when the release PR was just merged, builds and ships every target.
|
|
5
|
+
#
|
|
6
|
+
# launchset decides the mode (publish, ship, release-pr, none) and the plan
|
|
7
|
+
# build one job per target: stamp -> verify -> YOUR build and upload steps -> mark
|
|
8
|
+
# finalize creates the release tag and the GitHub Release once every auto target shipped
|
|
9
|
+
#
|
|
10
|
+
# Add your own build and upload steps in the `build` job, where the comments say so.
|
|
11
|
+
name: Launchset release
|
|
12
|
+
|
|
13
|
+
on:
|
|
14
|
+
push:
|
|
15
|
+
branches:
|
|
16
|
+
@@branches@@
|
|
17
|
+
workflow_dispatch:
|
|
18
|
+
inputs:
|
|
19
|
+
target:
|
|
20
|
+
description: >-
|
|
21
|
+
Manual target to ship (for example an iOS app that is not built on every release).
|
|
22
|
+
Leave empty to retry an unfinished release of the current version.
|
|
23
|
+
required: false
|
|
24
|
+
type: string
|
|
25
|
+
version:
|
|
26
|
+
description: >-
|
|
27
|
+
Released version to ship, used together with target. Default: the latest release on
|
|
28
|
+
this branch.
|
|
29
|
+
required: false
|
|
30
|
+
type: string
|
|
31
|
+
force:
|
|
32
|
+
description: >-
|
|
33
|
+
Ship the target even if it already shipped a higher version (stores usually reject
|
|
34
|
+
lower versions).
|
|
35
|
+
required: false
|
|
36
|
+
type: boolean
|
|
37
|
+
default: false
|
|
38
|
+
attempt:
|
|
39
|
+
description: >-
|
|
40
|
+
Used together with target, for a target with the semver build-number strategy: the
|
|
41
|
+
last two digits of its build number (1 to 99), to upload the same version again.
|
|
42
|
+
Default: the run attempt.
|
|
43
|
+
required: false
|
|
44
|
+
type: string
|
|
45
|
+
|
|
46
|
+
# One group per pushed commit, so GitHub never cancels a waiting run (it keeps only one
|
|
47
|
+
# waiting run per group): a release-commit push always gets its publish run. Runs for older
|
|
48
|
+
# commits leave the release PR to the run for the newest one, and the release branch is
|
|
49
|
+
# pushed with a lease, so concurrent runs can't overwrite each other.
|
|
50
|
+
concurrency:
|
|
51
|
+
group: launchset-release-${{ github.ref }}-${{ github.sha }}
|
|
52
|
+
cancel-in-progress: false
|
|
53
|
+
|
|
54
|
+
permissions:
|
|
55
|
+
contents: read
|
|
56
|
+
|
|
57
|
+
jobs:
|
|
58
|
+
launchset:
|
|
59
|
+
name: Plan release
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
permissions:
|
|
62
|
+
contents: read
|
|
63
|
+
outputs:
|
|
64
|
+
mode: ${{ steps.launchset.outputs.mode }}
|
|
65
|
+
matrix: ${{ steps.launchset.outputs.matrix }}
|
|
66
|
+
plan: ${{ steps.launchset.outputs.plan }}
|
|
67
|
+
version: ${{ steps.launchset.outputs.version }}
|
|
68
|
+
build-number: ${{ steps.launchset.outputs.build-number }}
|
|
69
|
+
channel: ${{ steps.launchset.outputs.channel }}
|
|
70
|
+
release-sha: ${{ steps.launchset.outputs.release-sha }}
|
|
71
|
+
steps:
|
|
72
|
+
# A GitHub App token, not GITHUB_TOKEN: events caused by GITHUB_TOKEN do not trigger other
|
|
73
|
+
# workflows, so the release PR would never run its checks. Needs the org variable
|
|
74
|
+
# LAUNCHSET_APP_CLIENT_ID and the org secret LAUNCHSET_APP_PRIVATE_KEY (see "GitHub App
|
|
75
|
+
# setup" in the launchset docs). Older setups store the App ID as the secret
|
|
76
|
+
# LAUNCHSET_APP_ID instead: it works in client-id too, so it is the fallback.
|
|
77
|
+
- id: app-token
|
|
78
|
+
uses: actions/create-github-app-token@v3
|
|
79
|
+
with:
|
|
80
|
+
client-id: ${{ vars.LAUNCHSET_APP_CLIENT_ID || secrets.LAUNCHSET_APP_ID }}
|
|
81
|
+
private-key: ${{ secrets.LAUNCHSET_APP_PRIVATE_KEY }}
|
|
82
|
+
- uses: actions/checkout@v7
|
|
83
|
+
with:
|
|
84
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
85
|
+
fetch-depth: 0
|
|
86
|
+
- id: launchset
|
|
87
|
+
uses: @@action@@
|
|
88
|
+
with:
|
|
89
|
+
command: release
|
|
90
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
91
|
+
target: ${{ inputs.target }}
|
|
92
|
+
version: ${{ inputs.version }}
|
|
93
|
+
|
|
94
|
+
build:
|
|
95
|
+
name: Build ${{ matrix.target }}
|
|
96
|
+
needs: launchset
|
|
97
|
+
# Only for publish and ship, and only when there is something to build (a matrix without
|
|
98
|
+
# values is an error in GitHub Actions).
|
|
99
|
+
if: contains(fromJSON('["publish","ship"]'), needs.launchset.outputs.mode) && needs.launchset.outputs.matrix != '[]'
|
|
100
|
+
runs-on: @@runs_on@@
|
|
101
|
+
permissions:
|
|
102
|
+
@@build_permissions@@
|
|
103
|
+
strategy:
|
|
104
|
+
# One failing target must not stop the others: re-run the failed job afterwards.
|
|
105
|
+
fail-fast: false
|
|
106
|
+
matrix:
|
|
107
|
+
target: ${{ fromJSON(needs.launchset.outputs.matrix) }}
|
|
108
|
+
steps:
|
|
109
|
+
# Always build the release commit, never a later one.
|
|
110
|
+
- uses: actions/checkout@v7
|
|
111
|
+
with:
|
|
112
|
+
ref: ${{ needs.launchset.outputs.release-sha }}
|
|
113
|
+
@@login_steps@@
|
|
114
|
+
# Writes the version and build number into this target's files (in this checkout only).
|
|
115
|
+
- id: stamp
|
|
116
|
+
uses: @@action@@
|
|
117
|
+
with:
|
|
118
|
+
command: stamp
|
|
119
|
+
target: ${{ matrix.target }}
|
|
120
|
+
plan: ${{ needs.launchset.outputs.plan }}
|
|
121
|
+
|
|
122
|
+
# Checks the store, registry or npm: has this version already been uploaded?
|
|
123
|
+
# Sets `already-published`, which the build steps below use to skip themselves.
|
|
124
|
+
- id: verify
|
|
125
|
+
uses: @@action@@
|
|
126
|
+
with:
|
|
127
|
+
command: verify
|
|
128
|
+
target: ${{ matrix.target }}
|
|
129
|
+
plan: ${{ needs.launchset.outputs.plan }}
|
|
130
|
+
@@verify_env@@
|
|
131
|
+
|
|
132
|
+
# ---------------------------------------------------------------------------------------
|
|
133
|
+
# Your build and upload steps go here, one group per target. Give every step
|
|
134
|
+
# if: matrix.target == '<name>' && steps.verify.outputs.already-published != 'true'
|
|
135
|
+
# so it is skipped when the version is already published. The stamp step outputs
|
|
136
|
+
# (version, build-number, channel, dist-tag, docker-tags, docker-labels) tell your steps
|
|
137
|
+
# what to build and where to upload: `channel` is release, prerelease or preview.
|
|
138
|
+
# ---------------------------------------------------------------------------------------
|
|
139
|
+
@@build_steps@@
|
|
140
|
+
# ---------------------------------------------------------------------------------------
|
|
141
|
+
|
|
142
|
+
# Records that this target shipped (the marker tag). Runs after the steps above succeeded,
|
|
143
|
+
# and also when the version was already published. The token is minted here, not at the
|
|
144
|
+
# start of the job, because it expires after an hour and native builds can take long.
|
|
145
|
+
- id: mark-token
|
|
146
|
+
uses: actions/create-github-app-token@v3
|
|
147
|
+
with:
|
|
148
|
+
client-id: ${{ vars.LAUNCHSET_APP_CLIENT_ID || secrets.LAUNCHSET_APP_ID }}
|
|
149
|
+
private-key: ${{ secrets.LAUNCHSET_APP_PRIVATE_KEY }}
|
|
150
|
+
- uses: @@action@@
|
|
151
|
+
with:
|
|
152
|
+
command: mark
|
|
153
|
+
target: ${{ matrix.target }}
|
|
154
|
+
plan: ${{ needs.launchset.outputs.plan }}
|
|
155
|
+
token: ${{ steps.mark-token.outputs.token }}
|
|
156
|
+
|
|
157
|
+
finalize:
|
|
158
|
+
name: Finalize release
|
|
159
|
+
needs: [launchset, build]
|
|
160
|
+
# Runs even when a build failed, to report which targets are missing.
|
|
161
|
+
if: always() && contains(fromJSON('["publish","ship"]'), needs.launchset.outputs.mode)
|
|
162
|
+
runs-on: ubuntu-latest
|
|
163
|
+
permissions:
|
|
164
|
+
contents: read
|
|
165
|
+
steps:
|
|
166
|
+
- id: app-token
|
|
167
|
+
uses: actions/create-github-app-token@v3
|
|
168
|
+
with:
|
|
169
|
+
client-id: ${{ vars.LAUNCHSET_APP_CLIENT_ID || secrets.LAUNCHSET_APP_ID }}
|
|
170
|
+
private-key: ${{ secrets.LAUNCHSET_APP_PRIVATE_KEY }}
|
|
171
|
+
- uses: actions/checkout@v7
|
|
172
|
+
with:
|
|
173
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
174
|
+
ref: ${{ needs.launchset.outputs.release-sha }}
|
|
175
|
+
fetch-depth: 0
|
|
176
|
+
# Creates the release tag and the GitHub Release when every auto target has shipped.
|
|
177
|
+
- uses: @@action@@
|
|
178
|
+
with:
|
|
179
|
+
command: finalize
|
|
180
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
181
|
+
plan: ${{ needs.launchset.outputs.plan }}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# --- @@target@@ (android): example steps, uncomment and adapt ---
|
|
2
|
+
# Remove this step once you've added the build and upload steps below: it stops the release
|
|
3
|
+
# from marking @@target@@ as shipped while nothing builds it.
|
|
4
|
+
- name: Build steps missing (@@target@@)
|
|
5
|
+
if: @@if@@
|
|
6
|
+
run: |
|
|
7
|
+
echo "::error::No build steps for @@target@@ yet. Add them to this workflow and remove this step."
|
|
8
|
+
exit 1
|
|
9
|
+
# `stamp` already wrote versionName and versionCode into the Gradle files. `channel` picks the
|
|
10
|
+
# Google Play track: release -> production, prerelease -> beta, preview -> internal.
|
|
11
|
+
# Secrets are referenced by name only: add them as repository or organization secrets.
|
|
12
|
+
#
|
|
13
|
+
# - name: Set up Java (@@target@@)
|
|
14
|
+
# if: @@if@@
|
|
15
|
+
# uses: actions/setup-java@v6
|
|
16
|
+
# with:
|
|
17
|
+
# distribution: temurin
|
|
18
|
+
# java-version: "21"
|
|
19
|
+
# - name: Build the app bundle (@@target@@)
|
|
20
|
+
# if: @@if@@
|
|
21
|
+
# working-directory: @@android_dir@@
|
|
22
|
+
# run: ./gradlew bundleRelease
|
|
23
|
+
# env:
|
|
24
|
+
# LAUNCHSET_VERSION: ${{ steps.stamp.outputs.version }}
|
|
25
|
+
# LAUNCHSET_BUILD_NUMBER: ${{ steps.stamp.outputs.build-number }}
|
|
26
|
+
# LAUNCHSET_CHANNEL: ${{ steps.stamp.outputs.channel }}
|
|
27
|
+
# ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
|
28
|
+
# ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
|
29
|
+
# ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
|
30
|
+
# ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
|
31
|
+
# - name: Upload to Google Play (@@target@@)
|
|
32
|
+
# if: @@if@@
|
|
33
|
+
# working-directory: @@android_dir@@
|
|
34
|
+
# run: |
|
|
35
|
+
# bundle exec fastlane supply \
|
|
36
|
+
# --aab app/build/outputs/bundle/release/app-release.aab \
|
|
37
|
+
# --track "$PLAY_TRACK" \
|
|
38
|
+
# --package_name "@@package_name@@"
|
|
39
|
+
# env:
|
|
40
|
+
# PLAY_TRACK: ${{ steps.stamp.outputs.channel == 'release' && 'production' || (steps.stamp.outputs.channel == 'prerelease' && 'beta' || 'internal') }}
|
|
41
|
+
# SUPPLY_JSON_KEY_DATA: ${{ secrets.LAUNCHSET_PLAY_SERVICE_ACCOUNT_JSON }}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# `stamp` wrote the version into this target's `files`, if it has any. Example, for an npm
|
|
2
|
+
# package (and add `verify: ["npm"]` to the target to skip it when the version exists):
|
|
3
|
+
#
|
|
4
|
+
# - uses: actions/setup-node@v7
|
|
5
|
+
# if: @@if@@
|
|
6
|
+
# with:
|
|
7
|
+
# node-version: 24
|
|
8
|
+
# registry-url: https://registry.npmjs.org
|
|
9
|
+
# - run: npm publish --tag ${{ steps.stamp.outputs.dist-tag }}
|
|
10
|
+
# if: @@if@@
|
|
11
|
+
# env:
|
|
12
|
+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# --- @@target@@ (npm package) ---
|
|
2
|
+
# Publishes releases (skipped when `verify` finds this version on the registry) and
|
|
3
|
+
# prereleases. PR and branch previews are not published to npm.
|
|
4
|
+
- uses: actions/setup-node@v7
|
|
5
|
+
if: @@if@@
|
|
6
|
+
with:
|
|
7
|
+
node-version: 24
|
|
8
|
+
registry-url: https://registry.npmjs.org
|
|
9
|
+
# - run: npm ci && npm run build # build first, if the package needs it
|
|
10
|
+
# if: @@if@@
|
|
11
|
+
- name: Publish @@target@@ (npm)
|
|
12
|
+
if: @@if@@
|
|
13
|
+
# The dist-tag is `latest` for base-branch releases, so a hotfix on a maintenance branch
|
|
14
|
+
# does not move `latest`. Add --access public for a public scoped package.
|
|
15
|
+
run: npm publish --tag ${{ steps.stamp.outputs.dist-tag }}
|
|
16
|
+
env:
|
|
17
|
+
# Or use npm trusted publishing: give this job `id-token: write` and drop the token here.
|
|
18
|
+
# `verify` still needs a read token for a private package: trusted publishing can't read.
|
|
19
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# --- @@target@@ (custom): your build and publish steps go here ---
|
|
2
|
+
# Remove this step once you've added the build and upload steps below: it stops the release
|
|
3
|
+
# from marking @@target@@ as shipped while nothing builds it.
|
|
4
|
+
- name: Build steps missing (@@target@@)
|
|
5
|
+
if: @@if@@
|
|
6
|
+
run: |
|
|
7
|
+
echo "::error::No build steps for @@target@@ yet. Add them to this workflow and remove this step."
|
|
8
|
+
exit 1
|
|
9
|
+
@@example@@
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Log in to the registry. In the release workflow this runs before `verify` on purpose: for a
|
|
2
|
+
# private package the registry check needs read access. The login also covers the push below.
|
|
3
|
+
- name: Log in to @@registry_name@@
|
|
4
|
+
if: @@if@@
|
|
5
|
+
uses: docker/login-action@v4
|
|
6
|
+
with:
|
|
7
|
+
@@registry_line@@
|
|
8
|
+
username: @@username@@
|
|
9
|
+
password: @@password@@
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# --- @@target@@ (docker) ---
|
|
2
|
+
- name: Set up Docker Buildx (@@target@@)
|
|
3
|
+
if: @@if@@
|
|
4
|
+
uses: docker/setup-buildx-action@v4
|
|
5
|
+
- name: Build and push @@target@@
|
|
6
|
+
if: @@if@@
|
|
7
|
+
uses: docker/build-push-action@v7
|
|
8
|
+
with:
|
|
9
|
+
context: @@context@@
|
|
10
|
+
@@file_line@@
|
|
11
|
+
@@platforms_line@@
|
|
12
|
+
push: true
|
|
13
|
+
# The tags and labels come from launchset and follow the `tags` config of this target.
|
|
14
|
+
tags: ${{ steps.stamp.outputs.docker-tags }}
|
|
15
|
+
labels: ${{ steps.stamp.outputs.docker-labels }}
|
|
16
|
+
cache-from: type=gha,scope=@@target@@
|
|
17
|
+
cache-to: type=gha,mode=max,scope=@@target@@
|