diff --git a/.github/actions/assemble-release/action.yml b/.github/actions/assemble-release/action.yml index 2afd5d9..81f5e8a 100644 --- a/.github/actions/assemble-release/action.yml +++ b/.github/actions/assemble-release/action.yml @@ -44,6 +44,7 @@ runs: run: | shopt -s nocaseglob # so globs are case-insensitive shopt -s globstar + shopt -s nullglob mkdir -p ${{ env.RELEASE_STAGING }} cp -r -v ${{ inputs.artifacts }} ${{ env.RELEASE_STAGING }} cd ${{ env.RELEASE_STAGING }} @@ -52,8 +53,8 @@ runs: - name: Assemble Release id: assemble-release shell: bash + working-directory: ${{ env.RELEASE_STAGING }} run: | - cd ${{ env.RELEASE_STAGING }} zip -r ${{ github.workspace }}/${{ inputs.output-file-name }}.zip . echo 'ARTIFACT_FILENAME=${{ inputs.output-file-name }}' >> $GITHUB_ENV echo 'artifact-path=${{ github.workspace }}/${{ inputs.output-file-name }}' >> $GITHUB_OUTPUT @@ -65,3 +66,4 @@ runs: path: ${{ env.RELEASE_STAGING }} name: ${{ inputs.output-file-name }} if-no-files-found: error + include-hidden-files: 'true' # behavior changed in 4.4.0. Include hidden for matching the behavior of `zip` diff --git a/.github/workflows/internal-test-plugin-nuget.yml b/.github/workflows/internal-test-plugin-nuget.yml index ebfd955..6f5a4f1 100644 --- a/.github/workflows/internal-test-plugin-nuget.yml +++ b/.github/workflows/internal-test-plugin-nuget.yml @@ -1,5 +1,5 @@ # This is an internal test for KSPBuildTools and not intended to be used by other projects -name: Test Plugin Mod +name: Test Plugin Mod (NuGet) on: workflow_call: diff --git a/.github/workflows/internal-test-plugin.yml b/.github/workflows/internal-test-plugin.yml index 8d53e28..77877ad 100644 --- a/.github/workflows/internal-test-plugin.yml +++ b/.github/workflows/internal-test-plugin.yml @@ -22,6 +22,24 @@ jobs: solution-file-path: plugin-mod.csproj - uses: ./.github/actions/assemble-release + id: assemble-release with: - artifacts: ${{ env.TESTDIR }}/GameData + working-directory: ${{ env.TESTDIR }} output-file-name: plugin-mod + + - name: Get github artifact + uses: actions/download-artifact@v4 + with: + name: plugin-mod + path: github-artifact + + - name: Compare with zip artifact + run: | + unzip ${{ steps.assemble-release.outputs.artifact-path }} -d zip-artifact + + tree github-artifact + tree zip-artifact + + if [[ $(tree github-artifact/* | sed '1d') != $(tree zip-artifact/* | sed '1d') ]]; then echo "tree mismatch" && false; fi # fail if contents differ + if [[ ! -d github-artifact/GameData ]]; then echo "GameData not present" && false; fi # fail if GameData folder isnt present + if [[ -f github-artifact/GameData/plugin-mod/PluginMod.pdb ]]; then echo "pdb still present" && false; fi # fail if PDB is still present \ No newline at end of file