-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (65 loc) · 1.89 KB
/
Copy pathci.yml
File metadata and controls
77 lines (65 loc) · 1.89 KB
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
name: CI
on:
pull_request:
branches: [master]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/lint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/test
sync-version:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Sync package.json version
id: version-sync
run: |
ELM_VERSION=$(jq -r '.version' elm.json)
PKG_VERSION=$(jq -r '.version' package.json)
if [ "$ELM_VERSION" != "$PKG_VERSION" ]; then
pnpm version "$ELM_VERSION" --no-git-tag-version
echo "synced=true" >> $GITHUB_OUTPUT
else
echo "synced=false" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Commit version sync
if: steps.version-sync.outputs.synced == 'true'
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: chore: sync package.json version with elm.json
file_pattern: package.json pnpm-lock.yaml
branch: ${{ github.head_ref }}
check-publishable:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm
- run: pnpm install
shell: bash
- name: Check if publishable
id: publish
uses: ./.github/actions/publish
with:
dry-run: true
github-token: ''
- name: Fail if not publishable
if: steps.publish.outputs.is-publishable != 'true'
run: |
echo "::error::Version in elm.json is already published or invalid. Run 'elm bump' to update it."
exit 1
shell: bash