Skip to content

Vertical landing and multiple tweaks #262

Vertical landing and multiple tweaks

Vertical landing and multiple tweaks #262

Workflow file for this run

name: CI
on:
pull_request_target:
branches:
- dev
- alpha
push:
branches:
- dev
- alpha
workflow_dispatch:
inputs:
publish:
type: boolean
description: Publish to workshop
addon:
type: choice
description: Workshop addon
options:
- beta
- alpha
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create gma file
run: |
docker run --rm \
--mount type=bind,source="$(pwd)",target=/addon \
mattjeanes/gmad \
create -folder /addon -out "/addon/addon.gma"
- name: Set workshop addon id
if: (github.event_name == 'push' && contains(fromJSON('["refs/heads/dev", "refs/heads/alpha"]'), github.ref)) || github.event.inputs.publish == 'true'
run: |
if [[ "${{ github.event.inputs.addon }}" == "beta" || "${{ github.ref }}" == "refs/heads/dev" ]]; then
WORKSHOP_ID=${{ vars.BETA_WORKSHOP_ID }}
elif [[ "${{ github.event.inputs.addon }}" == "alpha" || "${{ github.ref }}" == "refs/heads/alpha" ]]; then
WORKSHOP_ID=${{ vars.ALPHA_WORKSHOP_ID }}
else
echo "Unknown workshop ID" 1>&2
exit 1
fi
echo "Publishing to workshop ID $WORKSHOP_ID"
echo "WORKSHOP_ID=$WORKSHOP_ID" >> $GITHUB_ENV
- name: Publish to workshop
if: env.WORKSHOP_ID
run: |
docker run --rm \
-e STEAM_USER="${{ vars.STEAM_USERNAME }}" \
-e STEAM_PASSWORD="${{ secrets.STEAM_PASSWORD }}" \
--mount type=bind,source="$(pwd)",target=/home/gmodws/upload \
aperturedevelopment/gmodws:latest \
upload ${{ env.WORKSHOP_ID }} addon.gma \
"${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}"