feat(game): stones and aggro #535
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: .NET Pipeline | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' | |
# setup .NET | |
- name: Setup .NET Core SDK 9 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
- name: Build | |
run: dotnet build --verbosity minimal src/QuantumCore.sln | |
- name: Test | |
run: dotnet test --no-build src/QuantumCore.sln | |
publish_single: | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
# only deploy if on master or tag | |
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
os: [ win-x64, osx-x64, linux-x64, linux-musl-x64 ] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' | |
- name: Setup .NET Core SDK 9 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 9.0.x | |
- name: Build | |
run: dotnet publish -r ${{ matrix.os }} --verbosity minimal -p DebugType=None -p DebugSymbols=false -p PublishSingleFile=true --self-contained src/Executables/Single/ | |
- name: Archive build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: QuantumCore Single ${{ matrix.os }} | |
path: src/Executables/Single/bin/Release/net9.0/${{ matrix.os }}/publish | |
deploy: | |
needs: | |
- test | |
permissions: | |
contents: read | |
packages: write | |
runs-on: ubuntu-latest | |
# only deploy if on master or tag | |
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Login to Docker Registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: ${{ env.REGISTRY }} | |
# game | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta-game | |
uses: docker/[email protected] | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/game | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=tag | |
type=raw,latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} | |
- name: Build and push game image | |
uses: docker/[email protected] | |
with: | |
context: src/ | |
file: src/Executables/Game/Dockerfile | |
push: true | |
tags: ${{ steps.meta-game.outputs.tags }} | |
labels: ${{ steps.meta-game.outputs.labels }} | |
# auth | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta-auth | |
uses: docker/[email protected] | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/auth | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=tag | |
type=raw,latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} | |
- name: Build and push auth image | |
uses: docker/[email protected] | |
with: | |
context: src/ | |
images: ghcr.io/meikellp/quantum-core-x/auth | |
file: src/Executables/Auth/Dockerfile | |
push: true | |
tags: ${{ steps.meta-auth.outputs.tags }} | |
labels: ${{ steps.meta-auth.outputs.labels }} |