New Crowdin updates #724
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: 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: | | |
wget -O /tmp/fastgmad.zip "https://github.com/WilliamVenner/fastgmad/releases/download/v0.2.0/fastgmad_linux.zip" | |
unzip /tmp/fastgmad.zip -d /tmp/fastgmad | |
chmod +x /tmp/fastgmad/fastgmad | |
mkdir -p /tmp/addon | |
/tmp/fastgmad/fastgmad create -folder . -out /tmp/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="/tmp/addon",target=/home/gmodws/upload \ | |
aperturedevelopment/gmodws:latest \ | |
upload ${{ env.WORKSHOP_ID }} addon.gma \ | |
"${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}" |