-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (70 loc) · 2.38 KB
/
main.yaml
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
# Continuous Integration jobs for changes pointed to main.
---
name: Main
'on':
merge_group:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Prepare job
uses: ./.github/actions/pnpm-install
- name: Check formatting
run: pnpm run check-format
- name: Lint
run: pnpm run lint
- name: Run tests
run: pnpm run test
release:
name: Release
if: github.repository == 'bfra-me/works' && github.ref == 'refs/heads/main'
needs:
- ci
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- id: get-workflow-access-token
name: Get Workflow Access Token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
with:
app-id: ${{ secrets.APPLICATION_ID }}
private-key: ${{ secrets.APPLICATION_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Setup Git user
run: |
git config --global user.email '118100583+bfra-me[bot]@users.noreply.github.com'
git config --global user.name 'bfra-me[bot]'
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
token: ${{ steps.get-workflow-access-token.outputs.token }}
- name: Prepare job
uses: ./.github/actions/pnpm-install
- name: Perform a dry run of `pnpm publish`
run: pnpm -r publish --dry-run
- name: Create Release Pull Request or Publish to npm
uses: changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 # v1.4.9
with:
commit: 'chore(changesets): publish packages'
publish: pnpm publish-changesets
setupGitUser: false
title: 'chore(🦋📦): publish packages'
version: pnpm version-changesets
env:
GITHUB_TOKEN: ${{ steps.get-workflow-access-token.outputs.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}