-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (37 loc) · 1.04 KB
/
publish.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
name: Publish
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Deno setup
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x
- name: Test
run: deno task test
- name: Check format, linting, types
run: deno task check
- name: Publish to JSR
run: deno publish
- name: Publish to Deno.land/x
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git fetch --tags
VERSION=$(jq -r '.version' deno.json)
if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo "Tag $VERSION already exists, doing nothing."
else
# If the tag does not exist, create and push it
git tag "$VERSION"
git push origin "$VERSION"
fi