1+ name : Build for Linux & Windows
2+
3+ on :
4+ push :
5+ tags :
6+ - v*
7+
8+ jobs :
9+ build :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout
13+ uses : actions/checkout@v2
14+ with :
15+ fetch-depth : 0
16+
17+ - name : Set env
18+ run : echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
19+
20+ - name : Install Docker
21+ run : curl -fsSL https://get.docker.com | bash -s docker
22+
23+ - name : Setup Go
24+ uses : actions/setup-go@v2
25+ with :
26+ go-version : 1.18.2
27+
28+ - name : Go tidy
29+ run : go mod tidy
30+
31+ - name : Install fyne-cross
32+ run : go get github.com/fyne-io/fyne-cross && go install github.com/fyne-io/fyne-cross
33+
34+ - name : Package for Windows
35+ run : fyne-cross windows -arch=*
36+
37+ - name : Package for Linux
38+ run : fyne-cross linux -arch=*
39+
40+ - name : Create pkg dist dir
41+ run : mkdir pkg-dist
42+
43+ - name : Move Windows-amd64
44+ run : mv fyne-cross/dist/windows-amd64/Fetch-Github-Hosts.exe.zip pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_windows_amd64.zip
45+
46+ - name : Move Windows-386
47+ run : mv fyne-cross/dist/windows-386/Fetch-Github-Hosts.exe.zip pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_windows_386.zip
48+
49+ - name : Move Linux-386
50+ run : mv fyne-cross/dist/linux-386/Fetch-Github-Hosts.tar.xz pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_386.tar.xz
51+
52+ - name : Move Linux-amd64
53+ run : mv fyne-cross/dist/linux-amd64/Fetch-Github-Hosts.tar.xz pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_amd64.tar.xz
54+
55+ - name : Move Linux-arm
56+ run : mv fyne-cross/dist/linux-arm/Fetch-Github-Hosts.tar.xz pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_arm.tar.xz
57+
58+ - name : Move Linux-arm64
59+ run : mv fyne-cross/dist/linux-arm64/Fetch-Github-Hosts.tar.xz pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_arm64.tar.xz
60+
61+ - uses : actions/upload-artifact@v3
62+ with :
63+ name : build-result
64+ path : |
65+ pkg-dist
66+
67+ - name : Release
68+ uses : softprops/action-gh-release@v1
69+ if : startsWith(github.ref, 'refs/tags/')
70+ with :
71+ draft : true
72+ append_body : true
73+ files : |
74+ pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_windows_amd64.zip
75+ pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_windows_386.zip
76+ pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_386.tar.xz
77+ pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_amd64.tar.xz
78+ pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_arm.tar.xz
79+ pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_arm64.tar.xz
80+ env :
81+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments