-
-
Notifications
You must be signed in to change notification settings - Fork 131
48 lines (44 loc) · 1.56 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Continuous Deployment
on:
push:
tags:
- "*"
jobs:
publish-github:
name: Publish on Github
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
$Env:PATH = "${Env:USERPROFILE}\go\bin;${Env:PATH}"
$version = ${Env:GITHUB_REF}.Replace("refs/tags/","")
$Env:GO_BUILD_OPTS = "-ldflags `"-w -s -X github.com/yuk7/wsldl/version.version=${version}`""
$Env:PATH = "${Env:USERPROFILE}\go\bin;${Env:PATH}"
echo AMD64 build
.\build.bat all
move out out_amd64
echo ARM64 build
$Env:GOARCH="arm64"
.\build.bat all
move out out_arm64
- name: Zip package and rename
run: |
Compress-Archive -Path .\out_amd64\icons\* -DestinationPath .\out_amd64\icons.zip
move .\out_arm64\wsldl.exe .\out_arm64\wsldl_arm64.exe
Compress-Archive -Path .\out_arm64\icons\* -DestinationPath .\out_arm64\icons_arm64.zip
- name: Release body
run: |
$version = ${Env:GITHUB_REF}.Replace("refs/tags/","")
echo "![downloads](https://img.shields.io/github/downloads/yuk7/wsldl/${version}/total?style=flat-square)" > body.txt
- name: Upload the release
uses: softprops/action-gh-release@v1
with:
body_path: body.txt
files: |
out_amd64/wsldl.exe
out_amd64/icons.zip
out_arm64/wsldl_arm64.exe
out_arm64/icons_arm64.zip
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}