Skip to content

Commit 61ea7e2

Browse files
committed
ci: add publish workflow
1 parent 8aa30be commit 61ea7e2

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Publish
2+
run-name: Publish ${{ inputs.package }}
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
package:
8+
description: The package to publish
9+
required: true
10+
type: choice
11+
options:
12+
- forgeworks
13+
- minigames
14+
skip-automatic-bump:
15+
description: Whether to skip the automatic bumping of the package version
16+
required: false
17+
default: false
18+
type: boolean
19+
20+
jobs:
21+
PublishPackage:
22+
name: Publish ${{ inputs.package }}
23+
runs-on: ubuntu-latest
24+
permissions:
25+
id-token: write
26+
contents: write
27+
steps:
28+
- name: Checkout Project
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
ref: main
33+
- name: Use Node.js v22
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: 22
37+
- name: Enable Yarn
38+
run: corepack enable yarn
39+
- name: Install Dependencies
40+
run: yarn install --immutable
41+
- name: Configure Git
42+
run: |
43+
git remote set-url origin "https://${GITHUB_TOKEN}:x-oauth-basic@github.com/${GITHUB_REPOSITORY}.git"
44+
git config --local user.email "${GITHUB_EMAIL}"
45+
git config --local user.name "${GITHUB_USER}"
46+
env:
47+
GITHUB_USER: github-actions[bot]
48+
GITHUB_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
- name: Build
51+
run: yarn build
52+
- name: Bump Versions and make release
53+
working-directory: packages/${{ inputs.package }}
54+
run: |
55+
if [ "${{ inputs.skip-automatic-bump }}" = "true" ]; then
56+
yarn bump --skip-automatic-bump
57+
else
58+
yarn bump
59+
fi
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)