v0.4.0-pre-release-3 #58
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
release: | |
types: [published] | |
env: | |
IMAGE_REGISTRY: ghcr.io | |
IMAGE_OWNER: hotarublaze | |
IMAGE_NAME: gotes3mp | |
jobs: | |
build-linux-x64: | |
name: Build Linux - x64 | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
discussions: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ^1.22 | |
stable: true | |
id: linux-build | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
- name: Generate go files | |
run: | | |
cd src | |
go install google.golang.org/protobuf/cmd/protoc-gen-go | |
go get google.golang.org/grpc/cmd/protoc-gen-go-grpc | |
export PATH="$PATH:$(go env GOPATH)/bin" | |
go generate | |
cd .. | |
- name: Run Tests | |
run: go test ./src/... | |
- name: Build-Linux | |
run: | | |
cd src | |
CGO_ENABLED=0 go build -ldflags="-X 'main.Build=${{ github.event.release.tag_name }}' -X 'main.GitCommit=$GITHUB_SHA'" -o ../build/goTES3MP_Linux_amd64 . | |
- name: Generate default config | |
run: cd build/ && chmod +x goTES3MP_Linux_amd64 && ./goTES3MP_Linux_amd64 | |
- name: GH Release | |
uses: softprops/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: | | |
build/goTES3MP_Linux_amd64 | |
build/config.yaml | |
build-linux-aarch64: | |
name: Build Linux - aarch64 | |
runs-on: self-hosted | |
permissions: | |
contents: write | |
discussions: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ^1.22 | |
stable: true | |
id: linux-build | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
- name: Generate go files | |
run: | | |
cd src | |
go install google.golang.org/protobuf/cmd/protoc-gen-go | |
go get google.golang.org/grpc/cmd/protoc-gen-go-grpc | |
export PATH="$PATH:$(go env GOPATH)/bin" | |
go generate | |
cd .. | |
- name: Run Tests | |
run: go test ./src/... | |
- name: Build-Linux | |
run: | | |
cd src | |
CGO_ENABLED=0 go build -ldflags="-X 'main.Build=${{ github.event.release.tag_name }}' -X 'main.GitCommit=${GITHUB_SHA}'" -o ../build/goTES3MP-Linux-aarch64 . | |
- name: Generate default config | |
run: cd build/ && chmod +x goTES3MP-Linux-aarch64 && ./goTES3MP-Linux-aarch64 | |
- name: GH Release | |
uses: softprops/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: | | |
build/goTES3MP-Linux-aarch64 | |
build/config.yaml | |
build-windows: | |
name: Build Windows | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
discussions: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ^1.22 | |
stable: true | |
id: windows-build | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
- name: Generate go files | |
run: | | |
cd src | |
go install google.golang.org/protobuf/cmd/protoc-gen-go | |
go get google.golang.org/grpc/cmd/protoc-gen-go-grpc | |
export PATH="$PATH:$(go env GOPATH)/bin" | |
go generate | |
cd .. | |
- name: Run Tests | |
run: go test ./src | |
- name: Build-Windows | |
run: | | |
cd src | |
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-X 'main.Build=${{ github.event.release.tag_name }}' -X 'main.GitCommit=$GITHUB_SHA'" -o build/goTES3MP-Windows-amd64.exe . | |
- name: GH Release | |
uses: softprops/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: build/goTES3MP-Windows-amd64.exe | |
add-scripts: | |
name: Add Scripts | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
discussions: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Compress scripts | |
uses: papeloto/[email protected] | |
with: | |
files: tes3mp/ | |
dest: build/tes3mp-scripts.zip | |
- name: GH Release | |
uses: softprops/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: build/tes3mp-scripts.zip | |
build-dockerImage: | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_CONFIG: $HOME/.docker | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.IMAGE_REGISTRY }} | |
username: ${{ env.IMAGE_OWNER }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Docker Image | |
id: docker_build_x64 | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
platforms: linux/amd64 | |
labels: org.opencontainers.image.source https://github.com/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }} | |
tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }} | |
build-args: | | |
BUILD_VERSION=${{ github.event.release.tag_name }} | |
GITHUB_SHA=$GITHUB_SHA |