Skip to content

Commit e4d4c90

Browse files
authored
Fix/release pipeline (#66)
fix: fix the release pipeline 1. Tigger release when new version added 2. standardize the binary name Refs: #57 --------- Signed-off-by: seven <[email protected]>
1 parent bb7a284 commit e4d4c90

File tree

3 files changed

+36
-9
lines changed

3 files changed

+36
-9
lines changed

.github/workflows/release.yml

+10-9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ run-name: ${{ github.event.head_commit.message }}
33
on:
44
push:
55
branches: [ master ]
6+
7+
68
concurrency:
79
group: ${{ github.workflow }}-${{ github.ref }}
810
cancel-in-progress: true
@@ -91,31 +93,29 @@ jobs:
9193
file-digest: SHA256
9294
timestamp-rfc3161: http://timestamp.acs.microsoft.com
9395
timestamp-digest: SHA256
96+
- name: Collect Distribution Binaries
97+
env:
98+
PLATFORM: ${{ matrix.os }}
99+
run: ./scripts/collect-binaries.sh
100+
shell: bash
94101
- name: Upload Distribution Binaries
95102
uses: actions/upload-artifact@v4
96103
with:
97104
name: artifacts-${{ matrix.os }}
98-
path: |
99-
${{ github.workspace }}/src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg
100-
${{ github.workspace }}/src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
101-
${{ github.workspace }}/src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage
102-
${{ github.workspace }}\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\*.exe
105+
path: ${{ github.workspace }}/artifacts/*
103106

104107
release:
105108
needs: pre-release
106109
runs-on: ubuntu-latest
107110
steps:
108111
- name: Github checkout
109112
uses: actions/checkout@v4
110-
- run: echo "previous_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo '')" >> $GITHUB_ENV
111113
- name: Tag Release
112114
uses: jaywcjlove/create-tag-action@main
113-
if: env.previous_tag
114115
id: tag_release
115116
with:
116117
prerelease: true
117118
token: ${{ secrets.GITHUB_TOKEN }}
118-
package-path: ./package.json
119119
- name: Download Distribution Binaries
120120
uses: actions/download-artifact@v4
121121
if: steps.tag_release.outputs.successful
@@ -138,7 +138,8 @@ jobs:
138138
${{ steps.changelog.outputs.compareurl }}
139139
140140
${{ steps.changelog.outputs.changelog }}
141-
files: ${{ github.workspace }}/artifacts/**/*
141+
files:
142+
${{ github.workspace }}/artifacts/**/*
142143

143144
- name: Distribute Binaries to R2
144145
if: steps.tag_release.outputs.successful

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,4 @@ dist-ssr
109109
*.njsproj
110110
*.sln
111111
*.sw?
112+
/artifacts/

scripts/collect-binaries.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash -e
2+
set -o pipefail
3+
4+
cd "$(dirname "$0")/.." || exit
5+
6+
7+
VERSION=$(node -p "require('./package.json').version")
8+
PLATFORM=${PLATFORM:-"macos-latest"}
9+
10+
if [ ! -d artifacts ]; then
11+
mkdir artifacts
12+
fi
13+
14+
if [[ $PLATFORM == "windows-latest" ]]; then
15+
mv src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe artifacts/
16+
fi
17+
18+
if [[ $PLATFORM == "macos-latest" ]]; then
19+
mv src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg artifacts/
20+
fi
21+
22+
if [[ $PLATFORM == "ubuntu-latest" ]]; then
23+
mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb artifacts/DocKit_"${VERSION}"_amd64.deb
24+
mv src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage artifacts/DocKit_"${VERSION}"_amd64.AppImage
25+
fi

0 commit comments

Comments
 (0)