-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (64 loc) · 1.76 KB
/
ci.yml
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
# SPDX-FileCopyrightText: 2024 The Forkbomb Company
#
# SPDX-License-Identifier: AGPL-3.0-or-later
name: 📢 Tests, Release & Publish
on:
push:
branches:
- main
pull_request:
merge_group:
permissions:
contents: read
packages: write
jobs:
packageManager:
name: 🔍 Get pnpm version to use
runs-on: ubuntu-latest
outputs:
version: ${{ steps.ver.outputs.version }}
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: 🔍 Get pnpm version from pacakgeManager field
id: ver
run: |
echo "version=$( jq -r '.packageManager' package.json | cut -d@ -f2 )" >> $GITHUB_OUTPUT
test:
name: 🧪 Pnpm test
needs: [packageManager]
runs-on: ubuntu-latest
steps:
- name: 🛠️ Prepare pnpm workspace
uses: dyne/pnpm@main
with:
node-version: 20
pnpm-version: ${{ needs.packageManager.outputs.version }}
- name: 🧪 Run tests
run: |
pnpm test
semantic-release:
name: 🤖 Semantic release
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
needs: [packageManager, test]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: 🛠️ Prepare pnpm workspace
uses: dyne/pnpm@main
with:
node-version: 20
pnpm-version: ${{ needs.packageManager.outputs.version }}
- run: pnpm semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish_docker_image:
name: 🐳 Publish Docker image
needs: semantic-release
if: github.ref == 'refs/heads/main'
uses: ForkbombEu/workflows/.github/workflows/publish-ghcr.yml@main
secrets: inherit