Skip to content

Commit

Permalink
testing workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
phendryx committed Dec 27, 2022
1 parent 6af66d6 commit da0561c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 4 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# .github/workflows/release.yaml

on:
release:
types: [created]

jobs:
build-linux:
name: Build on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
- name: Build
run: make build-linux
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: update-linux-amd64.gz
build-windows:
name: Build on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
- name: Build
run: make build-windows
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: update-windows-amd64.exe.gz
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: albiondata-client-amd64-installer.exe
2 changes: 1 addition & 1 deletion scripts/build-darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export CC=/usr/osxcross/bin/o64-clang
export CXX=/usr/osxcross/bin/o64-clang++
export GOOS=darwin
export GOARCH=amd64 CGO_ENABLED=1
go build -ldflags "-s -w -X main.version=$CIRCLE_TAG" albiondata-client.go
go build -ldflags "-s -w -X main.version=$GITHUB_REF_NAME" albiondata-client.go


gzip -k9 albiondata-client
Expand Down
6 changes: 4 additions & 2 deletions scripts/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

set -eo pipefail

sudo apt-get install -y libpcap-dev
sudo apt-get update && apt-get install -y libpcap-dev

go build -ldflags "-s -w -X main.version=$CIRCLE_TAG" albiondata-client.go
go build -ldflags "-s -w -X main.version=$GITHUB_REF_NAME" albiondata-client.go
ls -la

gzip -9 albiondata-client
mv albiondata-client.gz update-linux-amd64.gz
ls -la
6 changes: 5 additions & 1 deletion scripts/build-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

set -eo pipefail

GITHUB_REF_NAME=1.2.3

sudo apt update && sudo apt install -y nsis nsis-pluginapi

export CGO_CPPFLAGS="-I $GOPATH/src/github.com/broderickhyman/albiondata-client/thirdparty/WpdPack/Include/"
export CGO_LDFLAGS="-L $GOPATH/src/github.com/broderickhyman/albiondata-client/thirdparty/WpdPack/Lib/x64/"
export GOOS=windows
export GOARCH=amd64
export CGO_ENABLED=1
export CXX=x86_64-w64-mingw32-g++
export CC=x86_64-w64-mingw32-gcc
go build -ldflags "-s -w -X main.version=$CIRCLE_TAG" -o albiondata-client.exe -v -x albiondata-client.go
go build -ldflags "-s -w -X main.version=$GITHUB_REF_NAME" -o albiondata-client.exe -v -x albiondata-client.go

# Add icon to the .exe
wine thirdparty/rcedit/rcedit.exe albiondata-client.exe --set-icon icon/albiondata-client.ico
Expand Down

0 comments on commit da0561c

Please sign in to comment.