-
Notifications
You must be signed in to change notification settings - Fork 17
75 lines (61 loc) · 2.2 KB
/
go.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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build NPM, Go and touch @artifacts branch
on:
workflow_dispatch:
push:
branches: [ "main" ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
# - name: Fake Build UX (just create build folder)
# run: mkdir -p app/ux/build; touch app/ux/build/index.html
- name: Setup Node
uses: actions/setup-node@v2.5.2
with:
node-version: v16
- name: Npm Install
run: npm install
working-directory: app/ux
- name: NPM Build
run: |
$env:CI=false
npm run build
working-directory: app/ux
- name: Build Main
run: |
$env:DEV_VERSION = ((Get-Content .\Makefile -TotalCount 1) -split '=')[1].Trim()
$env:CGO_CXXFLAGS="-I${{github.workspace}}\libs\webview2\build\native\include"
go build -a -trimpath -ldflags "-H=windowsgui -X github.com/pydio/cells-sync/common.Version=$env:DEV_VERSION" -o cells-sync.exe
- name: Build No-UI Version
run: |
$env:DEV_VERSION = ((Get-Content .\Makefile -TotalCount 1) -split '=')[1].Trim()
$env:CGO_ENABLED=0
go build -a -trimpath --tags pure -ldflags "-X github.com/pydio/cells-sync/common.Version=$env:DEV_VERSION" -o cells-sync-noui.exe
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: cells-sync-windows
path: cells-sync*.exe
- name: Checkout Artifacts
uses: actions/checkout@v4
with:
ref: artifacts
path: artifacts
- name: Notify branch
run: |
echo '{"run_id":"${{ github.run_id }}", "run_number":"${{ github.run_number }}", "run_attempt":"${{ github.run_attempt }}", "sha":"${{ github.sha }}"}' > latest.json
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "regenerated latest file"
git push
working-directory: artifacts