-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (77 loc) · 2.79 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
86
87
# Continuous Integration jobs for changes headed to main.
---
name: Main
'on':
merge_group:
pull_request:
branches: [main]
types: [opened, synchronize, ready_for_review, reopened]
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Checkout Branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 📦 Enable Corepack
run: corepack enable
- name: 🏆 Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
cache: pnpm
node-version-file: '.node-version'
- name: 🧰 Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
- name: 💅🏽 Run Prettier
run: pnpm check-format
- name: 🧹 Run ESLint
run: pnpm lint
release:
if: github.repository == 'bfra-me/.github' && github.event_name == 'push' && github.ref =='refs/heads/main'
name: Release
needs: [lint]
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 }}
- run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
cache: pnpm
node-version-file: '.node-version'
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Create Release Pull Request or Publish to npm
uses: changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 # v1.4.9
with:
commit: 'chore(changesets): publish release'
publish: pnpm release
setupGitUser: false
title: 'chore(🦋📦): publish release'
version: pnpm bump
env:
GH_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ steps.get-workflow-access-token.outputs.token }}