From 65031be081c17e3fe8da0a9b3fd68a21d81edbc2 Mon Sep 17 00:00:00 2001 From: Andrew Cassidy Date: Fri, 17 May 2024 20:33:10 -0700 Subject: [PATCH] Fix missing env variables and make it error if they don't exist --- .github/workflows/ksp-publish.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ksp-publish.yml b/.github/workflows/ksp-publish.yml index c07ffdf..8d93506 100644 --- a/.github/workflows/ksp-publish.yml +++ b/.github/workflows/ksp-publish.yml @@ -25,7 +25,7 @@ jobs: - name: Generate Version Info run: | - echo "VERSION_TITLE=$(yaclog show -n)" >> $GITHUB_ENV + yaclog show python Scripts/version.py yaclog-ksp -n "Conformal Decals" @@ -99,11 +99,18 @@ jobs: python -m pip install --upgrade pip python -m pip install yaclog + - name: Get version name and body + run: | + echo "VERSION_TITLE=$(yaclog show -n)" >> $GITHUB_ENV + echo "VERSION_CHANGELOG=$(yaclog show -mb)" >> $GITHUB_ENV + yaclog show + - name: Download Build Artifacts uses: actions/download-artifact@v4 - name: Zip Download Packages run: | + set -u mkdir bundled mkdir unbundled zip -r bundled/ConformalDecals-$VERSION_TITLE.zip ConformalDecals/* @@ -112,11 +119,12 @@ jobs: - name: Publish to Spacedock run: | + set -u curl -F "username=drewcassidy" -F "password=${{ secrets.SPACEDOCK_PASS }}" \ -c ./cookies "https://spacedock.info/api/login" curl -c ./cookies -b ./cookies \ -F "version=$VERSION_TITLE" \ - -F "changelog=$(yaclog show -mb)" \ + -F "changelog=$VERSION_CHANGELOG" \ -F "game-version=1.12.3" \ -F "notify-followers=yes" \ -F "zipball=@bundled/ConformalDecals-$VERSION_TITLE.zip" \ @@ -124,10 +132,11 @@ jobs: - name: Publish to Github run: | + set -u gh release create ${{ github.ref_name }} \ - --notes "$(yaclog show -mb)" \ - --title "Version $(yaclog show -n)" \ - bundled/ConformalDecals-*.zip \ + --notes "$VERSION_CHANGELOG" \ + --title "Version $VERSION_TITLE" \ + bundled/ConformalDecals-*.zip ConformalDecals/GameData/ConformalDecals/Versioning/ConformalDecals.version env: