Skip to content

Commit f3f8af5

Browse files
committed
ci: use new shared publish workflow (#826)
1 parent 35e5ac0 commit f3f8af5

File tree

3 files changed

+28
-36
lines changed

3 files changed

+28
-36
lines changed

.github/workflows/cd.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Filename (cd.yml) should match the workflow filename in Trusted Publisher setting on npmjs
2+
name: Publish to NPM & Github
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
branches:
8+
- main
9+
- rel/**
10+
11+
permissions:
12+
id-token: write # Required for OIDC
13+
contents: write
14+
15+
jobs:
16+
publish:
17+
if: |
18+
github.event.pull_request.merged == true &&
19+
contains(github.event.pull_request.title, 'chore: Release')
20+
uses: OneSignal/sdk-actions/.github/workflows/publish-npm-github.yml@main
21+
with:
22+
branch: ${{ github.event.pull_request.base.ref }}
23+
packages: '["com.onesignal.unity.core", "com.onesignal.unity.android", "com.onesignal.unity.ios"]'

.github/workflows/create-release-pr.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ jobs:
131131
create-pr:
132132
needs: [prep, update-version]
133133
uses: OneSignal/sdk-actions/.github/workflows/create-release.yml@main
134+
secrets:
135+
# Need this cross-repo token (sdk-actions & this repo) to perform changes
136+
GH_PUSH_TOKEN: ${{ secrets.GH_PUSH_TOKEN }}
134137
with:
135138
# Need target_repo otherwise caller would set github.repository to the caller itself (e.g. sdk-actions)
136139
target_repo: OneSignal/OneSignal-Unity-SDK
@@ -148,7 +151,9 @@ jobs:
148151
- name: Checkout
149152
uses: actions/checkout@v5
150153
with:
154+
repository: OneSignal/OneSignal-Unity-SDK
151155
ref: ${{ needs.prep.outputs.release_branch }}
156+
token: ${{ secrets.GH_PUSH_TOKEN || github.token }}
152157

153158
- name: Get PR release notes
154159
id: notes

.github/workflows/publish-to-npm.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)