2020-07-04 21:29:03 +00:00
|
|
|
name: "Build & Test"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-07-04 22:06:23 +00:00
|
|
|
branches-ignore:
|
|
|
|
- 'master'
|
|
|
|
- 'release/**'
|
2020-07-04 21:29:03 +00:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-go@v2
|
|
|
|
with:
|
2020-09-18 03:39:20 +00:00
|
|
|
go-version: '1.15.2'
|
2020-07-04 21:29:03 +00:00
|
|
|
- name: Build
|
2020-10-17 20:52:38 +00:00
|
|
|
run: |
|
|
|
|
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X github.com/pterodactyl/wings/system.Version=dev-${GIT_COMMIT:0:7}" -o build/wings_linux_amd64 -v wings.go
|
|
|
|
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w -X github.com/pterodactyl/wings/system.Version=dev-${GIT_COMMIT:0:7}" -o build/wings_linux_arm64 -v wings.go
|
2020-07-04 21:29:03 +00:00
|
|
|
- name: Test
|
|
|
|
run: go test ./...
|
2020-07-04 22:19:29 +00:00
|
|
|
- name: Compress binary and make it executable
|
2020-07-04 22:10:35 +00:00
|
|
|
if: ${{ github.ref == 'refs/heads/develop' || github.event_name == 'pull_request' }}
|
2020-10-17 20:52:38 +00:00
|
|
|
run: |
|
|
|
|
upx build/wings_linux_amd64 && chmod +x build/wings_linux_amd64
|
|
|
|
upx build/wings_linux_arm64 && chmod +x build/wings_linux_arm64
|
2020-07-04 21:29:03 +00:00
|
|
|
- uses: actions/upload-artifact@v2
|
2020-07-04 22:10:35 +00:00
|
|
|
if: ${{ github.ref == 'refs/heads/develop' || github.event_name == 'pull_request' }}
|
2020-07-04 21:29:03 +00:00
|
|
|
with:
|
2020-07-04 21:44:22 +00:00
|
|
|
name: wings_linux_amd64
|
2020-07-05 01:26:36 +00:00
|
|
|
path: build/wings_linux_amd64
|
2020-10-17 20:52:38 +00:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
if: ${{ github.ref == 'refs/heads/develop' || github.event_name == 'pull_request' }}
|
|
|
|
with:
|
|
|
|
name: wings_linux_arm64
|
|
|
|
path: build/wings_linux_arm64
|