Skip to content

Commit ede8f21

Browse files
author
EspressoTrip-v2
committed
git workflows
1 parent 992b6c8 commit ede8f21

3 files changed

Lines changed: 71 additions & 120 deletions

File tree

.github/workflows/dev-package.yml

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

.github/workflows/publish.yml

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

.github/workflows/release.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Release
2+
on:
3+
push:
4+
branches: [main]
5+
workflow_dispatch: # For dev publishing
6+
7+
concurrency: ${{ github.workflow }}-${{ github.ref }}
8+
permissions:
9+
id-token: write # Required for OIDC / trusted publishing
10+
contents: write # Required for changesets pushing commits
11+
pull-requests: write # Required for changesets creating PRs
12+
13+
jobs:
14+
release:
15+
name: Publish Packages
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
ref: ${{github.event.pull_request.head.sha}}
21+
fetch-depth: 0
22+
23+
- uses: actions/checkout@v4
24+
with:
25+
repository: journeyapps-platform/ci-actions
26+
token: ${{ secrets.SHARED_GH_TOKEN }}
27+
path: .github/ci
28+
ref: v1
29+
30+
- name: Enable Corepack
31+
run: corepack enable
32+
33+
34+
- name: Setup NodeJS
35+
uses: actions/setup-node@v6
36+
with:
37+
node-version-file: ".nvmrc"
38+
cache: pnpm
39+
40+
41+
- name: Update npm
42+
run: |
43+
npm install -g npm@latest
44+
npm --version
45+
46+
- name: Install dependencies
47+
run: pnpm install
48+
49+
50+
- name: Has changesets
51+
uses: bluwy/detect-changesets-action@v1
52+
id: detect
53+
54+
- name: Build
55+
run: pnpm build
56+
57+
- name: Create Release Pull Request or Publish to npm
58+
id: changesets
59+
uses: changesets/action@v1
60+
if: ${{ github.event_name == 'push' }}
61+
with:
62+
version: pnpm changeset:version
63+
publish: ci:publish
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
67+
- name: Dev publish
68+
if: ${{ github.event_name == 'workflow_dispatch' }}
69+
run: pnpm ci:version
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)