-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (64 loc) · 2.45 KB
/
build.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: build
permissions:
contents: write
on: push
env:
MainBranch: main
MainFormat: "${major}.${minor}.${patch}"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set variables
id: vars
run: |
echo "currentBranch=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
- name: Set main version format
id: mainFormat
if: steps.vars.outputs.currentBranch == env.MainBranch
run: echo 'format=${{ env.MainFormat }}' >> $GITHUB_OUTPUT\
- name: Set prerelease version format
id: prereleaseFormat
if: steps.vars.outputs.currentBranch != env.MainBranch
run: echo 'format=${{ env.MainFormat }}-${{ steps.vars.outputs.currentBranch }}' >> $GITHUB_OUTPUT\
- name: Deno Setup
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x
- name: Deno Build
run: deno task build
- name: Set Version
id: version
uses: paulhatch/semantic-version@v5.0.2
with:
tag_prefix: "v"
major_pattern: "(MAJOR)"
minor_pattern: "(MINOR)"
version_format: ${{ steps.mainFormat.outputs.format || steps.prereleaseFormat.outputs.format }}
# namespace: ${{ steps.vars.outputs.currentBranch == env.MainBranch && null || steps.vars.outputs.currentBranch }}
# search_commit_body: false
bump_each_commit: true
user_format_type: "json"
enable_prerelease_mode: ${{ steps.vars.outputs.currentBranch != env.MainBranch }}
# - name: NPM Package Build
# run: |
# deno task npm:build ${{ steps.version.outputs.version }}
# npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
# - name: NPM Package Publish Release
# if: steps.vars.outputs.currentBranch == env.MainBranch
# run: deno task npm:publish
# - name: NPM Package Publish Prerelease
# if: steps.vars.outputs.currentBranch != env.MainBranch
# run: deno task npm:publish --tag ${{ steps.vars.outputs.currentBranch }}
- name: Tag commit ${{ steps.version.outputs.version }}
run: |
git tag v${{ steps.version.outputs.version }} ${{ steps.commit.outputs.commit }}
git push origin v${{ steps.version.outputs.version }}