-
Notifications
You must be signed in to change notification settings - Fork 125
81 lines (63 loc) · 2.77 KB
/
build-linux-windows.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
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
79
80
81
name: Build for Linux & Windows
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install Docker
run: curl -fsSL https://get.docker.com | bash -s docker
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.20.2
- name: Go tidy
run: go mod tidy
- name: Install fyne-cross
run: go get github.com/fyne-io/fyne-cross && go install github.com/fyne-io/fyne-cross
- name: Package for Windows
run: fyne-cross windows -arch=*
- name: Package for Linux
run: fyne-cross linux -arch=*
- name: Create pkg dist dir
run: mkdir pkg-dist
- name: Move Windows-amd64
run: mv fyne-cross/dist/windows-amd64/Fetch-Github-Hosts.exe.zip pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_windows_amd64.zip
- name: Move Windows-386
run: mv fyne-cross/dist/windows-386/Fetch-Github-Hosts.exe.zip pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_windows_386.zip
- name: Move Linux-386
run: mv fyne-cross/dist/linux-386/Fetch-Github-Hosts.tar.xz pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_386.tar.xz
- name: Move Linux-amd64
run: mv fyne-cross/dist/linux-amd64/Fetch-Github-Hosts.tar.xz pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_amd64.tar.xz
- name: Move Linux-arm
run: mv fyne-cross/dist/linux-arm/Fetch-Github-Hosts.tar.xz pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_arm.tar.xz
- name: Move Linux-arm64
run: mv fyne-cross/dist/linux-arm64/Fetch-Github-Hosts.tar.xz pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_arm64.tar.xz
- uses: actions/upload-artifact@v3
with:
name: build-result
path: |
pkg-dist
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
append_body: true
files: |
pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_windows_amd64.zip
pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_windows_386.zip
pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_386.tar.xz
pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_amd64.tar.xz
pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_arm.tar.xz
pkg-dist/fetch-github-hosts_${{ env.RELEASE_VERSION }}_linux_arm64.tar.xz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}