-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (88 loc) · 2.79 KB
/
Copy pathrelease.yml
File metadata and controls
91 lines (88 loc) · 2.79 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
name: Release
on:
workflow_dispatch:
inputs:
semver:
description: "The semver to use"
required: true
default: "auto"
type: choice
options:
- auto
- patch
- minor
- major
- prerelease
- prepatch
- preminor
- premajor
pull_request:
types: [closed]
jobs:
release:
if: >-
${{
(
startsWith(github.event.inputs.semver, 'pre') ||
github.ref == format(
'refs/heads/{0}',
github.event.repository.default_branch
)
) &&
(
github.event_name != 'pull_request' ||
github.event.pull_request.user.login == 'optic-release-automation[bot]'
)
}}
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- uses: nearform-actions/optic-release-automation-action@08642f7889f3bb519fb69ce2c3bf58e4f900c018 # v4.12.4
with:
commit-message: "Release {version}"
sync-semver-tags: false
access: "public"
# This prefix is added before the prerelease number, e.g. `v3.0.0-pre.0`
prerelease-prefix: "pre"
semver: ${{ github.event.inputs.semver }}
# Prereleases are published under the `next` npm dist-tag
npm-tag: ${{ startsWith(github.event.inputs.semver, 'pre') && 'next' || 'latest' }}
# Don't notify linked issues
notify-linked-issues: false
publish-mode: oidc
build-command: |
npm ci
# On a successful publish (optic publishes when its release PR merges into
# main), tell downstream repos to fast-track the bump of this package, rather
# than waiting for their daily Dependabot run. Receiver: digidem/comapeo-core-react-native.
notify-downstream:
needs: release
if: >-
needs.release.result == 'success' &&
github.event_name == 'pull_request' &&
github.event.pull_request.merged == true
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
downstream:
- owner: digidem
repo: comapeo-core-react-native
steps:
- uses: actions/create-github-app-token@v3
id: token
with:
app-id: ${{ vars.RELEASE_BOT_APP_ID }}
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
owner: ${{ matrix.downstream.owner }}
repositories: ${{ matrix.downstream.repo }}
- env:
GH_TOKEN: ${{ steps.token.outputs.token }}
run: |
gh api repos/${{ matrix.downstream.owner }}/${{ matrix.downstream.repo }}/dispatches \
-f event_type=first-party-release \
-f 'client_payload[package]=@comapeo/map-server'