Skip to content

Lock file maintenance (#81) #75

Lock file maintenance (#81)

Lock file maintenance (#81) #75

Workflow file for this run

name: Build and Release
on: [push]
env:
go-version: 1.22.x
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ env.go-version }}
uses: actions/setup-go@v5
with:
go-version: '${{ env.go-version }}'
- name: Install dependencies
run: go get ./cmd/screeps-launcher
- name: Vet
run: go vet ./...
- name: Test
run: go test ./...
- name: Upload sample
uses: actions/upload-artifact@v4
with:
name: config-sample
path: ./config.sample.yml
build:
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux, darwin, windows]
arch: [amd64, arm, arm64]
exclude:
- os: windows
arch: arm
- os: darwin
arch: arm
- os: darwin
arch: arm64
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ env.go-version }}
uses: actions/setup-go@v5
with:
go-version: '${{ env.go-version }}'
- name: Install dependencies
run: go get ./cmd/screeps-launcher
- name: Build
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o ./screeps-launcher_${{ matrix.os }}_${{ matrix.arch }} ./cmd/screeps-launcher
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: screeps-launcher-${{ matrix.os }}-${{ matrix.arch }}
path: ./screeps-launcher_${{ matrix.os }}_${{ matrix.arch }}
release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Rename Windows Files
run: for F in screeps-launcher_windows*; do mv $F $F.exe; done
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: |
screeps-launcher*
config.sample.yml
- name: Upload binaries
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin
asset_name: screeps-launcher_${{ matrix.os }}_${{ matrix.arch }}
asset_content_type: application/octet-stream