-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (102 loc) · 3.23 KB
/
release.yaml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Wails build
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
NODE_OPTIONS: "--max-old-space-size=4096"
jobs:
test-go:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Golang
uses: actions/setup-go@v4
with:
check-latest: true
go-version: '1.21'
- run: mkdir -p frontend/dist && touch frontend/dist/test.txt
- run: go test ./...
build:
name: Build
needs: test-go
outputs:
version: ${{ steps.create_release.outputs.tag }}
strategy:
matrix:
os: [windows]
arch: [amd64]
runs-on: ubuntu-latest
steps:
- name: Create release tag
id: create_release
run: |
TAG="v$(date +'%d%m%Y')-$(echo ${{ github.sha }} | cut -c1-8)"
echo "Creating release tag $TAG"
echo "::set-output name=tag::$TAG"
- run: mv ./artifacts/**/marshaller-* ./
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Golang
uses: actions/setup-go@v5
with:
check-latest: true
go-version: '1.21'
- name: Setup Nodejs
uses: actions/setup-node@v4
with:
node-version: '21.5'
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/[email protected]
- name: Install Linux Wails deps
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libgtk-3-0 libwebkit2gtk-4.0-dev gcc-aarch64-linux-gnu
- name: Install macOS Wails deps
if: runner.os == 'macOS'
run: brew install mitchellh/gon/gon
- name: Build App
run: wails build --platform ${{ matrix.os}}/${{ matrix.arch }} -webview2 embed -o marshaller-${{ matrix.os }}-${{ matrix.arch }} -ldflags "-X github.com/kacpermalachowski/marshal-controller/internal/build.Version=${{ steps.create_release.outputs.tag }} -X github.com/kacpermalachowski/marshal-controller/internal/build.Time=$(date)"
- name: Add macOS permissions
if: runner.os == 'macOS'
run: chmod +x build/bin/*/Contents/MacOS/*
shell: bash
- name: Add Linux permissions
if: runner.os == 'Linux'
run: chmod +x build/bin/*
shell: bash
- run: for x in marshaller-windows-*; do mv $x $x.exe; done
working-directory: ./build/bin/
if: matrix.os == 'windows'
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: marshaller-${{ matrix.os }}-${{ matrix.arch }}
path: ./build/bin/marshaller-*
retention-days: 1
create_release:
if: github.event_name == 'push'
name: Create release
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: ./marshaller-*
generateReleaseNotes: true
tag: ${{ needs.build.outputs.version }}