-
-
Notifications
You must be signed in to change notification settings - Fork 11
132 lines (127 loc) · 3.59 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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ci
cancel-in-progress: false
jobs:
setup:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.packages.outputs.packages }}
steps:
- uses: actions/checkout@v4
- id: packages
shell: bash
run: |
PACKAGES_LIST=$(find . -mindepth 2 -maxdepth 2 -type f -name deno.jsonc -exec bash -c 'basename $(dirname {})' \;)
PACKAGES_LIST_JSON=$(echo "$PACKAGES_LIST" | jq --raw-input --compact-output --slurp 'split("\n")[:-1]')
echo "packages: $PACKAGES_LIST_JSON"
echo "packages=$PACKAGES_LIST_JSON" >> $GITHUB_OUTPUT
test:
runs-on: ubuntu-latest
needs:
- setup
strategy:
fail-fast: false
matrix:
package: ${{fromJson(needs.setup.outputs.packages)}}
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: 1.x
- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.x
- uses: actions/setup-node@v4
with:
node-version: 22.x
- run: deno task ${{ matrix.package }}:ci
coverage:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs:
- setup
- test
environment:
name: github-pages
url: ${{ steps.pages.outputs.page_url }}
permissions:
id-token: write
contents: read
pages: write
steps:
- uses: actions/checkout@v4
- uses: actions/configure-pages@v5
- uses: denoland/setup-deno@v1
with:
deno-version: 1.x
- run: deno task coverage
- uses: actions/upload-pages-artifact@v3
with:
path: coverage
- id: pages
uses: actions/deploy-pages@v4
tag:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs:
- setup
- test
strategy:
fail-fast: false
matrix:
package: ${{fromJson(needs.setup.outputs.packages)}}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: tagging
uses: ldelarue/[email protected]
with:
tag-prefix: ${{ matrix.package }}-
scope: ${{ matrix.package }}
- uses: denoland/setup-deno@v1
- if: ${{ steps.tagging.outputs.tag }}
shell: bash
run: |
deno task tag --version '${{ steps.tagging.outputs.semver }}' ${{ matrix.package }}
deno fmt ${{ matrix.package }}/deno.jsonc
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git tag '${{ steps.tagging.outputs.tag }}'
git show-ref --tags '${{ steps.tagging.outputs.tag }}'
git push origin '${{ steps.tagging.outputs.tag }}'
git pull --ff-only
git add ${{ matrix.package }}/deno.jsonc
git commit -m "chore: bump version ${{ steps.tagging.outputs.tag }}"
git push
publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs:
- setup
- test
- tag
permissions:
id-token: write
contents: read
packages: write
strategy:
fail-fast: false
matrix:
package: ${{fromJson(needs.setup.outputs.packages)}}
steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: denoland/setup-deno@v1
- run: deno task ${{ matrix.package }}:publish