Skip to content

Commit 5ad63b8

Browse files
author
Your Name
committed
Set extension version
1 parent ad0fc89 commit 5ad63b8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,27 @@ jobs:
2929
always-auth: true
3030
cache: 'yarn'
3131

32+
- name: Set version
33+
run: |
34+
case ${{ github.event_name }} in
35+
release)
36+
VERSION="${{ github.event.release.tag_name }}"
37+
yarn version --no-git-tag-version --new-version "${VERSION#v}"
38+
;;
39+
pull_request)
40+
VERSION=$(git describe --tags | grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+')
41+
QUALIFIER=$(git describe --tags | grep -Eo '-g[0-9a-f]+$')
42+
yarn version -s --no-git-tag-version --new-version "${VERSION#v}"
43+
yarn version --no-git-tag-version --prepatch --preid "pr${{ github.event.number }}${QUALIFIER}"
44+
;;
45+
*)
46+
VERSION=$(git describe --tags | grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+')
47+
QUALIFIER=$(git describe --tags | grep -Eo '[0-9]+\-g[0-9a-f]+$')
48+
yarn version -s --no-git-tag-version --new-version "${VERSION#v}"
49+
yarn version --no-git-tag-version --prepatch --preid "${{ github.ref_name }}${QUALIFIER}"
50+
;;
51+
esac
52+
3253
- name: Build
3354
env:
3455
GITHUB_TOKEN: ${{github.token}}

0 commit comments

Comments
 (0)