Skip to content

Commit

Permalink
Upload bundle to release
Browse files Browse the repository at this point in the history
  • Loading branch information
mksanger committed Jan 17, 2024
1 parent 8100cfd commit 608795f
Showing 1 changed file with 47 additions and 28 deletions.
75 changes: 47 additions & 28 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,27 @@ on:
- "*"

jobs:
release:

release_variables:
runs-on: ubuntu-latest

defaults:
run:
shell: bash -l -e -o pipefail {0}

steps:
- name: "Checkout code"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Fetch Tags"
# Workaround for https://github.com/actions/checkout/issues/290
run: |
# Avoid git exiting when Actions runs
git config --global --add safe.directory "$PWD"
git fetch --tags --force
- name: "Get release variables"
run: |
echo 'RELEASE_VERSION='$(git describe --always --tags) >> $GITHUB_ENV
echo 'MASTER_SHA='$(git rev-parse origin/master) >> $GITHUB_ENV
- name: "Create Release"
uses: ncipollo/release-action@v1.12.0
with:
name: ${{ env.RELEASE_VERSION }}
prerelease: ${{ !(github.sha == env.MASTER_SHA) }}
generateReleaseNotes: true

outputs:
isRelease: ${{ github.sha == env.MASTER_SHA }}

deploy:
runs-on: ubuntu-latest

needs: release
needs: release_variables

# Workaround for https://github.com/actions/runner/issues/1483
# Actions coerces boolean to string
if: needs.release.outputs.isRelease == 'true'
if: needs.release_variables.outputs.isRelease == 'true'

steps:
- name: "Free disk space on the runner"
Expand Down Expand Up @@ -110,6 +87,8 @@ jobs:

needs: deploy

if: always()

steps:
- name: install exodus
run: |
Expand All @@ -125,4 +104,44 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: client_bundle
path: "client_bundle.tgz"
path: "client_bundle.tgz"

release:
runs-on: ubuntu-latest

needs: bundle

if: always()

defaults:
run:
shell: bash -l -e -o pipefail {0}

steps:
- name: "Checkout code"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Fetch Tags"
# Workaround for https://github.com/actions/checkout/issues/290
run: |
# Avoid git exiting when Actions runs
git config --global --add safe.directory "$PWD"
git fetch --tags --force
- name: "Download artifact"
uses: actions/download-artifact@v3
with:
name: client_bundle

- name: "Create Release"
uses: ncipollo/release-action@v1.12.0
with:
name: ${{ env.RELEASE_VERSION }}
prerelease: ${{ !(github.sha == env.MASTER_SHA) }}
artifacts: "client_bundle.tgz"
removeArtifacts: true
artifactErrorsFailBuild: true
generateReleaseNotes: true

0 comments on commit 608795f

Please sign in to comment.