Skip to content

Commit 8ffc91a

Browse files
committed
chore: fix ci pipeline
1 parent 4fd9cdd commit 8ffc91a

8 files changed

+79
-72
lines changed
+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: compile-inno-setup
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
permissions:
8+
contents: write
9+
id-token: write
10+
packages: write
11+
12+
jobs:
13+
compile-inno-setup:
14+
name: Compile setup and publish
15+
runs-on: windows-latest
16+
defaults:
17+
run:
18+
working-directory: inno_setup
19+
steps:
20+
- name: Checkout version-fox
21+
uses: actions/checkout@v3
22+
- name: Get version-fox version
23+
id: version-fox-version
24+
uses: actions/github-script@v6
25+
with:
26+
github-token: NO_NEED
27+
result-encoding: string
28+
script: return "${{ github.ref }}".substring(11)
29+
- name: Install Inno Setup
30+
run: |
31+
curl --retry 10 --retry-all-errors -L -o installer.exe https://jrsoftware.org/download.php/is.exe
32+
./installer.exe /verysilent /allusers /dir=inst
33+
sleep 60
34+
- name: Download version-fox packages
35+
env:
36+
VFOX_VERSION: ${{ steps.version-fox-version.outputs.result }}
37+
DOWNLOAD_URL: https://github.com/${{ github.event.repository.full_name }}/releases/download
38+
run: |
39+
curl -L -o i386.zip ${{ env.DOWNLOAD_URL }}/v${{ env.VFOX_VERSION }}/vfox_${{ env.VFOX_VERSION }}_windows_i386.zip && unzip i386.zip
40+
curl -L -o x86_64.zip ${{ env.DOWNLOAD_URL }}/v${{ env.VFOX_VERSION }}/vfox_${{ env.VFOX_VERSION }}_windows_x86_64.zip && unzip x86_64.zip
41+
curl -L -o aarch64.zip ${{ env.DOWNLOAD_URL }}/v${{ env.VFOX_VERSION }}/vfox_${{ env.VFOX_VERSION }}_windows_aarch64.zip && unzip aarch64.zip
42+
- name: Compile by Inno Setup
43+
env:
44+
VFOX_VERSION: ${{ steps.version-fox-version.outputs.result }}
45+
run: |
46+
./inst/iscc vfox_windows_i386.iss
47+
./inst/iscc vfox_windows_x86_64.iss
48+
./inst/iscc vfox_windows_aarch64.iss
49+
- name: Upload Inno Setup Assets
50+
uses: version-fox/vfox-release-assets@v1
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
with:
54+
release_id: ${{ github.event.release.id }}
55+
assets_path: inno_setup/Output/*.exe

.github/workflows/go-releaser.yml

+2-46
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
args: release --clean ${{ env.flags }}
3232
env:
3333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
COSIGN_PWD: ${{ secrets.COSIGN_PWD }}
3435
HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TOKEN}}
3536

3637
- name: Publish rpm to Gemfury
@@ -39,49 +40,4 @@ jobs:
3940
run: |
4041
for filename in dist/vfox*.rpm; do
4142
curl -F package=@"$filename" https://{$FURY_TOKEN}@push.fury.io/versionfox/
42-
done
43-
44-
compile-inno-setup:
45-
name: Compile setup and publish
46-
needs: release
47-
runs-on: windows-latest
48-
defaults:
49-
run:
50-
working-directory: inno_setup
51-
steps:
52-
- name: Checkout version-fox
53-
uses: actions/checkout@v3
54-
- name: Get version-fox version
55-
id: version-fox-version
56-
uses: actions/github-script@v6
57-
with:
58-
github-token: NO_NEED
59-
result-encoding: string
60-
script: return "${{ github.event.release.tag_name }}".substring(1)
61-
- name: Install Inno Setup
62-
run: |
63-
curl --retry 10 --retry-all-errors -L -o installer.exe https://jrsoftware.org/download.php/is.exe
64-
./installer.exe /verysilent /allusers /dir=inst
65-
sleep 60
66-
- name: Download version-fox packages
67-
env:
68-
VFOX_VERSION: ${{ steps.version-fox-version.outputs.result }}
69-
DOWNLOAD_URL: https://github.com/${{ github.event.repository.full_name }}/releases/download
70-
run: |
71-
curl -L -o i386.zip ${{ env.DOWNLOAD_URL }}/v${{ env.VFOX_VERSION }}/vfox_${{ env.VFOX_VERSION }}_windows_i386.zip && unzip i386.zip
72-
curl -L -o x86_64.zip ${{ env.DOWNLOAD_URL }}/v${{ env.VFOX_VERSION }}/vfox_${{ env.VFOX_VERSION }}_windows_x86_64.zip && unzip x86_64.zip
73-
curl -L -o aarch64.zip ${{ env.DOWNLOAD_URL }}/v${{ env.VFOX_VERSION }}/vfox_${{ env.VFOX_VERSION }}_windows_aarch64.zip && unzip aarch64.zip
74-
- name: Compile by Inno Setup
75-
env:
76-
TRZSZ_VERSION: ${{ steps.version-fox-version.outputs.result }}
77-
run: |
78-
./inst/iscc vfox_windows_i386.iss
79-
./inst/iscc vfox_windows_x86_64.iss
80-
./inst/iscc vfox_windows_aarch64.iss
81-
- name: Upload Inno Setup Assets
82-
uses: trzsz/upload-release-assets@v1
83-
env:
84-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85-
with:
86-
release_id: ${{ github.event.release.id }}
87-
assets_path: inno_setup/Output/*.exe
43+
done

.goreleaser.yaml

+2-8
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,10 @@ signs:
173173
- "--output-signature=${signature}"
174174
- "${artifact}"
175175
- --yes
176-
docker_signs:
177-
- cmd: cosign
178-
artifacts: manifests
179-
output: true
180-
args:
181-
- "sign"
182-
- "${artifact}@${digest}"
183-
- --yes
184176

185177
release:
178+
draft: false
179+
prerelease: true
186180
name_template: "v{{ .Version }}"
187181
footer: |
188182
**Full Changelog**: https://github.com/version-fox/vfox/compare/{{ .PreviousTag }}...{{ if .IsNightly }}nightly{{ else }}{{ .Tag }}{{ end }}

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,8 @@ assert(resp.body == '{"ip": "xxx.xxx.xxx.xxx"}')
413413
414414
##### 2. JSON Library
415415
416+
Based on [gopher-json](https://github.com/layeh/gopher-json/)
417+
416418
```lua
417419
local json = require("json")
418420

inno_setup/vfox_windows_aarch64.iss

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ DisableDirPage=yes
1919
DefaultGroupName={#MyAppName}
2020
DisableProgramGroupPage=yes
2121
OutputBaseFilename=vfox_{#MyAppVersion}_windows_setup_aarch64
22-
Compression=lzma
22+
Compression=zip
2323
SolidCompression=yes
2424
WizardStyle=modern
2525
ChangesEnvironment=true

inno_setup/vfox_windows_i386.iss

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ DisableDirPage=yes
1919
DefaultGroupName={#MyAppName}
2020
DisableProgramGroupPage=yes
2121
OutputBaseFilename=vfox_{#MyAppVersion}_windows_setup_i386
22-
Compression=lzma
22+
Compression=zip
2323
SolidCompression=yes
2424
WizardStyle=modern
2525
ChangesEnvironment=true

inno_setup/vfox_windows_x86_64.iss

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ DisableDirPage=yes
1919
DefaultGroupName={#MyAppName}
2020
DisableProgramGroupPage=yes
2121
OutputBaseFilename=vfox_{#MyAppVersion}_windows_setup_x86_64
22-
Compression=lzma
22+
Compression=zip
2323
SolidCompression=yes
2424
WizardStyle=modern
2525
ChangesEnvironment=true

install.sh

+15-15
Original file line numberDiff line numberDiff line change
@@ -29,41 +29,41 @@ else
2929
fi
3030

3131
# Get the latest version
32-
VERSION=$(curl --silent "https://api.github.com/repos/version-fox/vfox/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
32+
VERSION=$(curl --silent "https://api.github.com/repos/version-fox/vfox/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c 2-)
3333

3434
if [ -z "$VERSION" ]; then
3535
echo "Failed to get the latest version. Please check your network connection and try again."
3636
exit 1
3737
fi
38-
echo "Installing vfox $VERSION ..."
38+
echo "Installing vfox v$VERSION ..."
3939

4040
# Check if the OS is supported
4141
OS_TYPE=$(uname -s | tr '[:upper:]' '[:lower:]')
42-
ARCH_TYPE=$(uname -m)
43-
if [ "$ARCH_TYPE" = "x86_64" ]; then
44-
ARCH_TYPE="amd64"
45-
elif [ "$ARCH_TYPE" = "aarch64" ]; then
46-
ARCH_TYPE="arm64"
47-
else
48-
echo "Unsupported architecture type: $ARCH_TYPE"
49-
exit 1
42+
if [ "$OS_TYPE" = "darwin" ]; then
43+
OS_TYPE="macos"
5044
fi
5145

52-
FILENAME="version-fox_${VERSION}_${OS_TYPE}_${ARCH_TYPE}.tar.gz"
46+
ARCH_TYPE=$(uname -m)
47+
48+
FILENAME="vfox_${VERSION}_${OS_TYPE}_${ARCH_TYPE}"
49+
TAR_FILE="${FILENAME}.tar.gz"
50+
51+
echo https://github.com/version-fox/vfox/releases/download/v$VERSION/$TAR_FILE
52+
$DOWNLOAD_CMD https://github.com/version-fox/vfox/releases/download/v$VERSION/$TAR_FILE
5353

54-
$DOWNLOAD_CMD https://github.com/version-fox/vfox/releases/download/$VERSION/$FILENAME
5554

56-
tar -zxvf $FILENAME
55+
tar -zxvf $TAR_FILE
5756
if [ $? -ne 0 ]; then
5857
echo "Failed to extract vfox binary. Please check if the downloaded file is a valid tar.gz file."
5958
exit 1
6059
fi
6160

62-
sudo mv vf /usr/local/bin
61+
sudo mv "${FILENAME}/vfox" /usr/local/bin
6362

6463
if [ $? -ne 0 ]; then
6564
echo "Failed to move vfox to /usr/local/bin. Please check your sudo permissions and try again."
6665
exit 1
6766
fi
68-
rm $FILENAME
67+
rm $TAR_FILE
68+
rm -rf $FILENAME
6969
echo "vfox installed successfully!"

0 commit comments

Comments
 (0)