-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.19 KB
/
Copy pathrelease.yml
File metadata and controls
48 lines (40 loc) · 1.19 KB
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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-and-release:
name: Build & Publish Release
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Run Unit Tests
run: go test -v ./...
- name: Build Windows Executables
shell: pwsh
run: |
New-Item -ItemType Directory -Path dist -Force
$env:GOOS="windows"; $env:GOARCH="amd64"; go build -ldflags="-s -w" -o dist/phpvm-windows-amd64.exe .
$env:GOOS="windows"; $env:GOARCH="arm64"; go build -ldflags="-s -w" -o dist/phpvm-windows-arm64.exe .
Copy-Item dist/phpvm-windows-amd64.exe dist/phpvm.exe
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/phpvm.exe
dist/phpvm-windows-amd64.exe
dist/phpvm-windows-arm64.exe
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}