Skip to content

Commit 6676fe3

Browse files
committed
chore: 修复在macOS上无法修改版本号
1 parent 346b73f commit 6676fe3

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ jobs:
1717
uses: actions/checkout@v4
1818

1919
- name: Create Release
20-
run: gh release create v${{ github.event.inputs.version }} --title "v${{ github.event.inputs.version }}" || true
20+
run: |
21+
if [[ "${{ github.event.inputs.version }}" == *-* ]]; then
22+
prerelease=true
23+
else
24+
prerelease=false
25+
fi
26+
gh release create v${{ github.event.inputs.version }} --title "v${{ github.event.inputs.version }}" --target "${{ github.sha }}" --prerelease "$prerelease" || true
2127
env:
2228
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2329

@@ -52,6 +58,14 @@ jobs:
5258
sudo apt-get install -y libx11-dev libxcursor-dev libxinerama-dev libxi-dev libgl1-mesa-dev libfontconfig1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libwayland-dev libxkbcommon-dev
5359
5460
- name: Set version
61+
if: matrix.os != 'macos-latest'
62+
shell: bash
63+
run: |
64+
VERSION="${{ github.event.inputs.version }}"
65+
sed -i "s/^version = \"0.0.0-dev\"/version = \"$VERSION\"/" Cargo.toml
66+
67+
- name: Set version (BSD)
68+
if: matrix.os == 'macos-latest'
5569
shell: bash
5670
run: |
5771
VERSION="${{ github.event.inputs.version }}"

0 commit comments

Comments
 (0)