-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (99 loc) · 2.77 KB
/
Copy pathbuild.yaml
File metadata and controls
115 lines (99 loc) · 2.77 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Build
on:
push:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
env:
BASH_ENV: /tmp/bash_env
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup mise
uses: jdx/mise-action@v2
with:
github_token: ${{ github.token }}
- name: Activate mise
run: |
# shellcheck disable=SC2016
echo 'eval "$(mise activate bash)"' >> "$BASH_ENV"
# shellcheck disable=SC1090
. "$BASH_ENV"
mise doctor
- name: Run Checks
run: hk check --all
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
BASH_ENV: /tmp/bash_env
steps:
- name: Configure Git
if: runner.os == 'Windows'
run: |
git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v4
- name: Setup mise
uses: jdx/mise-action@v2
with:
github_token: ${{ github.token }}
- name: Run tests (posix)
if: runner.os != 'Windows'
shell: bash
run: |
eval "$(mise activate bash)"
echo "::group::mise doctor"
mise doctor
echo "::endgroup::"
mise run test
- name: Run tests (windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$shimPath = "$env:USERPROFILE\AppData\Local\mise\shims"
$currentPath = [Environment]::GetEnvironmentVariable('Path', 'User')
$newPath = $currentPath + ";" + $shimPath
[Environment]::SetEnvironmentVariable('Path', $newPath, 'User')
echo "::group::mise doctor"
mise doctor
echo "::endgroup::"
mise run test
publish:
needs: [lint, test]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
env:
BASH_ENV: /tmp/bash_env
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup mise
uses: jdx/mise-action@v2
with:
github_token: ${{ github.token }}
- name: Activate mise
run: |
# shellcheck disable=SC2016
echo 'eval "$(mise activate bash)"' >> "$BASH_ENV"
# shellcheck disable=SC1090
. "$BASH_ENV"
mise doctor
- name: Semantic Release
if: github.event_name == 'push'
uses: cycjimmy/semantic-release-action@v4
with:
extra_plugins: |
@semantic-release/commit-analyzer
@semantic-release/release-notes-generator
@semantic-release/exec
@semantic-release/git
@semantic-release/github
env:
GITHUB_TOKEN: ${{ github.token }}