-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (56 loc) · 1.7 KB
/
ci.yaml
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
name: ci
on:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- run: deno fmt --check
- run: deno lint
- run: deno doc --lint ./mod.ts
- run: deno test --coverage
- run: deno coverage --lcov > coverage.lcov
- uses: codecov/codecov-action@v4
with:
file: ./coverage.lcov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
test-build:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- run: deno run -A ./scripts/prepare_release.ts
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [test]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- uses: actions/setup-node@v4
with:
node-version: 20
# this is a hack for @semantic-release/npm verifyConditions as it expects a package.json to exist already but it's only generated during the prepare step
- run: |
mkdir npm && echo '{ "name": "remember-promise" }' > npm/package.json
- run: npx -p @semantic-release/changelog -p @semantic-release/exec -p @semantic-release/git -p semantic-release semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: deno publish