Skip to content

Commit

Permalink
allow removing some files from artifacts, and add output file path
Browse files Browse the repository at this point in the history
  • Loading branch information
drewcassidy committed Sep 11, 2024
1 parent ad3a9bb commit 4c4ca8f
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions .github/actions/assemble-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,33 @@ name: assemble-release

inputs:
artifacts:
description: Space-separated list of file globs to include in the output artifact
description: Space-separated list of file globs to include in the output artifact, relative to `working-directory`
default: GameData LICENSE* README* CHANGELOG*

artifacts-exclude:
description: Space-separated list of file globs remove from the staging directory before zipping
default: '**/*.pdb'

output-file-name:
description: Output artifact name
default: ${{ github.event.repository.name || 'release'}}

working-directory:
default: ${{ github.workspace }}
description: the working directory to run in

outputs:
artifact-id:
value: ${{ steps.upload-artifact.outputs.artifact-id }}
description: Artifact ID from the upload-artifact action

artifact-url:
value: ${{ steps.upload-artifact.outputs.artifact-url }}
description: Artifact URL from the upload-artifact action

artifact-path:
value: ${{ steps.assemble-release.outputs.artifact-path }}
description: Local path to the produced zip file

runs:
using: composite
Expand All @@ -22,15 +38,23 @@ runs:
shell: bash
run: echo 'RELEASE_STAGING=${{ '/tmp/release' }}' >> "$GITHUB_ENV"

- name: Assemble Release
- name: Copy Files to Staging
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
mkdir -p ${{ env.RELEASE_STAGING }}
# TODO: delete pdb files? run some kind of assembly script?
cp -r -v ${{ inputs.artifacts }} ${{ env.RELEASE_STAGING }} || :
shopt -s nocaseglob # so globs are case-insensitive
mkdir -p ${{ env.RELEASE_STAGING }}
cp -r -v ${{ inputs.artifacts }} ${{ env.RELEASE_STAGING }}
cd ${{ env.RELEASE_STAGING }}
zip -r ${{ github.workspace }}/${{ inputs.output-file-name }}.zip .
rm ${{ inputs.artifacts-exclude }}
- name: Assemble Release
id: assemble-release
shell: bash
run: |
zip -r ${{ github.workspace }}/${{ inputs.output-file-name }}.zip ${{ env.RELEASE_STAGING }}
echo 'ARTIFACT_FILENAME=${{ inputs.output-file-name }}' >> $GITHUB_ENV
echo 'artifact-path=${{ github.workspace }}/${{ inputs.output-file-name }}' >> $GITHUB_OUTPUT
- name: Upload Artifact
id: upload-artifact
Expand Down

0 comments on commit 4c4ca8f

Please sign in to comment.