Write temporary build files to a tmpdir instead of the workspace (#91) #142
This file contains hidden or 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: 🚀 | |
| on: | |
| push: { branches: [main] } | |
| pull_request: {} | |
| workflow_dispatch: | |
| jobs: | |
| checkEnv: | |
| name: Check Env 🔎 | |
| runs-on: ubuntu-latest | |
| outputs: | |
| usernameExists: ${{ steps.checkUsername.outputs.usernameExists }} | |
| steps: | |
| - id: checkUsername | |
| env: | |
| STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }} | |
| if: env.STEAM_USERNAME != '' | |
| run: echo "usernameExists=true" >> $GITHUB_OUTPUT | |
| testDeploy: | |
| name: Deploy to Steam ☁ | |
| runs-on: ubuntu-latest | |
| # Only run tests if secrets are available (e.g. not from PRs from forked repos) | |
| needs: [checkEnv] | |
| if: needs.checkEnv.outputs.usernameExists == 'true' | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - run: | | |
| mkdir -p build/StandaloneWindows64 | |
| touch build/StandaloneWindows64/steam-deploy-test.txt | |
| mkdir -p build/StandaloneLinux64 | |
| touch build/StandaloneLinux64/steam-deploy-test.txt | |
| - uses: ./ | |
| with: | |
| username: ${{ secrets.STEAM_USERNAME }} | |
| configVdf: ${{ secrets.STEAM_CONFIG_VDF }} | |
| appId: ${{ secrets.TEST_APP_ID }} | |
| buildDescription: v0.0.1 | |
| rootPath: build | |
| depot1Path: StandaloneWindows64 | |
| depot2Path: StandaloneLinux64 | |
| releaseBranch: prerelease | |
| # Regression test for #79: the action must be runnable more than once in the same job, | |
| # and must not leave root-owned files behind in the workspace. | |
| - uses: ./ | |
| with: | |
| username: ${{ secrets.STEAM_USERNAME }} | |
| configVdf: ${{ secrets.STEAM_CONFIG_VDF }} | |
| appId: ${{ secrets.TEST_APP_ID }} | |
| buildDescription: v0.0.1 | |
| rootPath: build | |
| depot1Path: StandaloneWindows64 | |
| depot2Path: StandaloneLinux64 | |
| releaseBranch: prerelease | |
| - name: Workspace is clean and writable | |
| run: | | |
| test -z "$(find . -path ./.git -prune -o ! -writable -print)" | |
| test ! -e BuildOutput |