v0.4.0-discord_guildID #32
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: Run Tests | |
run: go test ./src/... | |
- name: Build-Linux | |
run: CGO_ENABLED=0 go build -ldflags="-X 'main.Build=${{ github.event.release.tag_name }}' -X 'main.GitCommit=$GITHUB_SHA'" -o build/goTES3MP-Linux src/*.go | |
- name: Generate default config | |
run: cd build/ && chmod +x goTES3MP-Linux && ./goTES3MP-Linux | |
- name: GH Release | |
uses: softprops/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: | | |
build/goTES3MP-Linux | |
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: Run Tests | |
run: go test ./src/... | |
- name: Build-Linux | |
run: CGO_ENABLED=0 go build -ldflags="-X 'main.Build=${{ github.event.release.tag_name }}' -X 'main.GitCommit=$GITHUB_SHA'" -o build/goTES3MP-Linux-aarm64 src/*.go | |
- name: Generate default config | |
run: cd build/ && chmod +x goTES3MP-Linux-aarm64 && ./goTES3MP-Linux-aarm64 | |
- name: GH Release | |
uses: softprops/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: | | |
build/goTES3MP-Linux-aarm64 | |
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: Run Tests | |
run: go test ./src | |
- name: Build-Windows | |
run: 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.exe src/*.go | |
- name: GH Release | |
uses: softprops/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: build/goTES3MP-Windows.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 |