-
-
Notifications
You must be signed in to change notification settings - Fork 9
150 lines (146 loc) · 4.33 KB
/
main.yaml
File metadata and controls
150 lines (146 loc) · 4.33 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: main
on:
push:
branches: "*"
tags: "*"
pull_request:
jobs:
test:
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- uses: actions/setup-node@v4
with:
node-version: "22"
- uses: pnpm/action-setup@v4
with:
version: 10
- run: deno task test --coverage --junit-path=junit.xml
env:
RUST_BACKTRACE: ${{ runner.debug }}
- uses: EnricoMi/publish-unit-test-result-action@v2
with:
check_name: "Test Results"
files: junit.xml
continue-on-error: true
- if: '!cancelled()'
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- run: deno coverage --lcov > coverage.lcov
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.lcov
- run: pnpm install
- run: pnpm run -r test
- run: deno task check
publish:
if: github.event_name == 'push'
needs: [test]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- uses: actions/setup-node@v4
with:
node-version: "22"
- uses: pnpm/action-setup@v4
with:
version: 10
- if: github.ref_type == 'branch'
run: |
set -euo pipefail
jq \
--arg build "$GITHUB_RUN_NUMBER" \
--arg commit "${GITHUB_SHA::8}" \
'.version = .version + "-dev." + $build + "+" + $commit' \
packages/botkit/deno.json > deno.json.tmp
mv deno.json.tmp packages/botkit/deno.json
jq \
--arg build "$GITHUB_RUN_NUMBER" \
--arg commit "${GITHUB_SHA::8}" \
'.version = .version + "-dev." + $build + "+" + $commit' \
packages/botkit/package.json > package.json.tmp
mv package.json.tmp packages/botkit/package.json
- if: github.ref_type == 'tag'
run: |
set -euo pipefail
[[ "$(jq -r .version deno.json)" = "$GITHUB_REF_NAME" ]]
[[ "$(jq -r .version package.json)" = "$GITHUB_REF_NAME" ]]
- run: |
set -euo pipefail
pnpm config set //registry.npmjs.org/:_authToken "$NPM_AUTH_TOKEN"
pnpm install
if [[ "$GITHUB_REF_TYPE" = tag ]]; then
pnpm publish --recursive --access public --no-git-checks
else
pnpm publish --recurisve --access public --no-git-checks --tag dev
fi
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NPM_CONFIG_PROVENANCE: "true"
- run: deno publish --allow-dirty
- if: github.ref_type == 'tag'
id: extract-changelog
uses: dahlia/submark@ed8f47b4d51fda07e12b6e991641a8bd5ec62f8e
with:
input-file: CHANGES.md
heading-level: 2
heading-title-text: version ${{ github.ref_name }}
ignore-case: true
omit-heading: true
- if: github.ref_type == 'tag'
run: 'cat "$CHANGES_FILE"'
env:
CHANGES_FILE: ${{ steps.extract-changelog.outputs.output-file }}
- if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v2
with:
body_path: ${{ steps.extract-changelog.outputs.output-file }}
name: BotKit ${{ github.ref_name }}
generate_release_notes: false
files: fedify-botkit-*.tgz
publish-docs:
if: github.event_name == 'push'
needs: [publish]
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: pnpm/action-setup@v4
with:
version: 10
- run: pnpm install
working-directory: docs
- run: pnpm build
env:
PLAUSIBLE_DOMAIN: ${{ vars.PLAUSIBLE_DOMAIN }}
SITEMAP_HOSTNAME: https://${{ vars.PLAUSIBLE_DOMAIN }}
working-directory: docs
- id: upload
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
- id: deploy
uses: actions/deploy-pages@v4
# cSpell: ignore denoland submark softprops