Skip to content

Commit

Permalink
NEW Output versions and artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Sep 4, 2023
1 parent aa130bb commit 89d52f0
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,25 @@ runs:
with:
node-version: ${{ steps.read-nvm.outputs.version }}

- name: Create temporary artifacts directory
shell: bash
run: |
# Note: creating the directory for artifacts one level up from the checkout directory so that we do not commit
# the artifacts to the repository is not allowed by actions/upload-artifact
mkdir __artifacts
# Ensure there will always at least one file in the archive so that there are no issues creating it
touch __artifacts/placeholder
- name: Output versions
shell: bash
run: |
echo "node version is:"
node --version
echo "npm version is:"
npm --version
echo "yarn version is:"
yarn --version
- name: Install admin JS
if: github.event.repository.name != 'silverstripe-admin'
shell: bash
Expand Down Expand Up @@ -142,10 +161,36 @@ runs:
fi
done
- name: Copy artifacts
if: always()
shell: bash
run: |
AT_LEAST_ONE_FILE=0
if [[ -f package.json ]]; then
cp package.json __artifacts
AT_LEAST_ONE_FILE=1
fi
if [[ -f yarn.lock ]]; then
cp yarn.lock __artifacts
AT_LEAST_ONE_FILE=1
fi
if [[ $AT_LEAST_ONE_FILE == 1 ]]; then
rm __artifacts/placeholder
fi
# https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
- name: Upload artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # @v3.1.2
if: always()
with:
name: artifacts
path: __artifacts

- name: Delete temporary files
shell: bash
if: always()
run: |
rm -rf __artifacts
if [[ -f __branches.json ]]; then
rm __branches.json
fi
Expand Down

0 comments on commit 89d52f0

Please sign in to comment.