Skip to content

Commit 61a242a

Browse files
authored
feat: resolve some issues with pipeline and enable manual trigger (#4)
1 parent d42440f commit 61a242a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/build-release.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Build, Push, and Release
33
on:
44
push:
55
branches: [ main ]
6+
workflow_dispatch:
67

78
jobs:
89
release:
@@ -17,8 +18,8 @@ jobs:
1718
with:
1819
node-version: 'lts/*'
1920

20-
- name: Install dependencies
21-
run: npm ci
21+
- name: Install semantic-release
22+
run: npm install --no-package-lock semantic-release @semantic-release/github
2223

2324
- name: Set up QEMU
2425
uses: docker/setup-qemu-action@v3
@@ -40,7 +41,12 @@ jobs:
4041

4142
- name: Get the version
4243
id: get_version
43-
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
44+
run: |
45+
if [ -n "${{ github.ref_name }}" ] && [[ "${{ github.ref_name }}" == v* ]]; then
46+
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
47+
else
48+
echo "VERSION=$(git describe --tags --abbrev=0 || echo v0.1.0)" >> $GITHUB_OUTPUT
49+
fi
4450
4551
- name: Build and push
4652
uses: docker/build-push-action@v5

0 commit comments

Comments
 (0)