Merge branch 'hotfix-7.0.5' into stable #85
This file contains 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: Continuous Integration | |
on: | |
push: | |
pull_request: | |
jobs: | |
ci: | |
name: CI for Preside CommandBox Commands | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup flow variables | |
run: | | |
branch=${GITHUB_REF##*/} | |
publish=false | |
if [[ "{{ env.event.name }}" != "pull_request" ]] ; then | |
if [[ $branch == release-* ]] || [[ $branch == v* ]] ; then | |
publish=true | |
fi | |
fi | |
echo "PUBLISH=$publish" >> $GITHUB_ENV | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Generate release version number | |
if: "env.PUBLISH == 'true'" | |
id: versiongen | |
uses: pixl8/github-action-twgit-release-version-generator@v1 | |
- name: Inject version into box json | |
if: "env.PUBLISH == 'true'" | |
uses: dominicwatson/github-action-envsubst@v1 | |
with: | |
files: box.json | |
patterns: $VERSION_NUMBER | |
env: | |
VERSION_NUMBER: ${{ steps.versiongen.outputs.semver_release_string }} | |
- name: Zip project | |
if: "env.PUBLISH == 'true'" | |
run: zip -rq $ZIP_FILE * -x jmimemagic.log -x .* -x *.sh -x *.log -x tests/**\* | |
shell: bash | |
env: | |
ZIP_FILE: ${{ steps.versiongen.outputs.semver_release_number }}.zip | |
- name: Create Release | |
if: "env.PUBLISH == 'true'" | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.versiongen.outputs.semver_release_string }} | |
release_name: Release ${{ steps.versiongen.outputs.semver_release_string }} | |
draft: false | |
prerelease: ${{ steps.versiongen.outputs.semver_release_is_snapshot }} | |
- name: Upload Release Asset | |
if: "env.PUBLISH == 'true'" | |
id: upload | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ${{ steps.versiongen.outputs.semver_release_number }}.zip | |
asset_name: ${{ steps.versiongen.outputs.semver_release_number }}.zip | |
asset_content_type: application/zip | |
- name: Inject download location | |
if: "env.PUBLISH == 'true'" | |
uses: DominicWatson/github-action-envsubst@stable | |
with: | |
files: box.json | |
env: | |
DOWNLOAD_URL: ${{ steps.upload.outputs.browser_download_url }} | |
- name: Publish to forgebox | |
if: "env.PUBLISH == 'true'" | |
uses: pixl8/github-action-box-publish@v3 | |
with: | |
forgebox_user: ${{ secrets.FORGEBOX_USER }} | |
forgebox_pass: ${{ secrets.FORGEBOX_PASS }} |