-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyrelease.back
78 lines (72 loc) · 2.59 KB
/
myrelease.back
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: myrelease
on:
push:
branches:
env:
BIN: testsetup
EXTRAFILES: docs/ examples/
permissions: write-all
jobs:
myrelease:
runs-on: windows-latest
steps:
- run: go tool dist list
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: install go-msi
run: choco install go-msi
- name: build-win-amd64
run: go build -v -o bin/win64/${{env.BIN}}.exe
- name: build-win32
run: |
$env:GOARCH="386"
go build -v -o bin/win32/${{env.BIN}}.exe
- name: build-android-arm64
run: |
$env:GOOS="android"
$env:GOARCH="arm64"
go build -v -o bin/android-arm64/${{env.BIN}}
- name: build MSIs
run: |
$env:Path += ";C:\Program Files\go-msi;C:\Program Files (x86)\WiX Toolset v3.11\bin"
$env:TMP = "${{ runner.temp }}"
$env:Tempdir = "${{ runner.temp }}"
go-msi.exe make -p wix64.json -a amd64 --msi ${{env.BIN}}-setup-amd64.msi --version 1.0.2
go-msi.exe make -p wix86.json -a 386 --msi ${{env.BIN}}-setup-x86.msi --version 1.0.2
- name: pack things to zip
run: |
7z a ${{env.BIN}}-windows-amd64.zip "./bin/win64/${{env.BIN}}.exe" ${{env.EXTRAFILES}}
7z a ${{env.BIN}}-windows-x86.zip "./bin/win32/${{env.BIN}}.exe" ${{env.EXTRAFILES}}
7z a ${{env.BIN}}-android-arm64.zip ./bin/android-arm64/${{env.BIN}} ${{env.EXTRAFILES}}
- name: get the version
id: curver
run: |
$v = $(git for-each-ref --sort=-creatordate --count 1 --format="%(refname:short)" "refs/tags/v*")
echo "ver=$(echo $v)" >> $env:GITHUB_OUTPUT
- name: show version
run: Write-Output ${{ steps.curver.outputs.ver }}
- name: bump semver
uses: actions-ecosystem/action-bump-semver@v1
id: bumpver
with:
current_version: ${{ steps.curver.outputs.ver }}
level: major
- name: push the tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git tag ${{ steps.bumpver.outputs.new_version }}
git push --tags
- name: release
uses: softprops/action-gh-release@v1
#if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ steps.bumpver.outputs.new_version }}
files: |
${{env.BIN}}-windows-amd64.zip
${{env.BIN}}-android-arm64.zip
${{env.BIN}}-windows-x86.zip
${{env.BIN}}-setup-x86.msi
${{env.BIN}}-setup-amd64.msi