From 4c8d2536b79f01adde98a20c33fd584f758f97cd Mon Sep 17 00:00:00 2001 From: Tristan Youngs Date: Tue, 14 Jan 2025 15:02:10 +0000 Subject: [PATCH] Update publish action. --- .github/workflows/publish/action.yml | 47 +++++++++++++++------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/.github/workflows/publish/action.yml b/.github/workflows/publish/action.yml index 50c954f0b0..14240ea4e2 100644 --- a/.github/workflows/publish/action.yml +++ b/.github/workflows/publish/action.yml @@ -10,6 +10,20 @@ inputs: - continuous - release - legacy + description: "Publishing type" + releaseTag: + type: string + description: "Existing tag which the release will be associated to on GitHub" + releaseName: + type: string + description: "Name of the release as it will appear on GitHub" + releaseBody: + type: string + description: "Body text of the release as it will appear on GitHub" + releaseBodyFile: + type: string + default: '' + description: "Body file to use for body text, used in preference to releaseBody if provided" runs: using: "composite" @@ -27,12 +41,6 @@ runs: merge-multiple: true path: ${{ github.workspace }}/packages - - name: Download Prerequisites - shell: bash - run: | - wget https://raw.githubusercontent.com/disorderedmaterials/scripts/master/update-release - chmod u+x ./update-release - - name: Package Examples shell: bash run: | @@ -40,22 +48,17 @@ runs: cd ./examples ./package-examples -v ${{ env.dissolveVersion }} - - name: Publish on GitHub (Release) - if: ${{ inputs.publishType == 'release' }} - shell: bash - run: | - echo "Release tag/name will be: ${{ env.dissolveVersion }}" - export GITHUB_TOKEN=${{ github.token }} - ./update-release -r disorderedmaterials/dissolve -t ${{ env.dissolveVersion }} -n "${{ env.dissolveVersion }}" -f ReleaseNotes.md packages/* examples/*.zip examples/*.tar.gz - - - name: Publish on GitHub (Continuous) - if: ${{ inputs.publishType == 'continuous' }} - shell: bash - run: | - echo "Release tag will be: continuous" - echo "Release name will be: 'Continuous (${{ env.dissolveVersion }} @ ${{ env.dissolveShortHash }})'" - export GITHUB_TOKEN=${{ github.token }} - ./update-release -r disorderedmaterials/dissolve -t continuous -p -e -u -n "Continuous (${{ env.dissolveVersion }} @ ${{ env.dissolveShortHash }})" -b "Continuous release from \`develop\` branch @ ${{ env.dissolveShortHash }}. Built $(date)." packages/* + - name: Publish on GitHub + if: ${{ inputs.publishType == 'release' || inputs.publishType == 'continuous' }} + uses: "./.github/workflows/create-release" + with: + releaseTag: ${{ inputs.releaseTag }} + releaseName: ${{ inputs.releaseName }} + releaseBody: ${{ inputs.releaseBody }} + releaseBodyFile: ${{ inputs.releaseBodyFile }} + releaseAssetsDirectory: "${{ github.workspace }}/packages" + updateRelease: ${{ inputs.publishType == 'continuous' }} + isPreRelease: ${{ inputs.publishType == 'continuous' }} - name: Publish on Harbor if: ${{ inputs.publishType != 'none' }}