From 62754015b03b3e7a7eed7684e0ad49cee4b285e7 Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Sat, 26 Nov 2022 15:05:45 -0800 Subject: [PATCH] Update Medley build workflow to add clos to release tars and to update various actions to latest versions (#1025) * Add clos to release tars for Medley. To ease adding clos to Medley Online. * Fix buildLoadup.yml to account for the fact that scripts/loadup-all.sh now automatically includes scripts/copy-all.sh. Was failing due to redundant copying of loadup files. * Get rid of ::set-output:: in buildLoadup.yml and replace with echo >> . This is due to that fact that ::set-output:: has been deprecated by Github and will soon cause an error if used in a workflow. * Update actions/checkout and robinraju/release-downloader to latest versions because versions currently being used relied on Node 12, which has been deprecated. Newer versions of these actions use Node 16, which is still supported. * Fix typo in actions/checkout new version number * Oops. Node 16 is supported by actions/checkout@v3 not by ...@v2.5.0 * Update AButler/upload-release-assets fron @v2.0 to @v2.0.2 to take care of Node 12 versus Node16 issues caused by Node 12 actions being deprecated by github. * Fix quoting bugs on conversions from ::set-output:: to * Try switching to the ncipollo/release-action acgtion in place of using the api to create the release and then the AButler/upload-release-assets action to upload the assets. This is to solve the failures when try to update a release using the force input parameter. * Adding step to delete existing release with given tag, if any. Needed when force parameter is true. * Fixing typo? * Typos again? * Start changing how RELEASE_TAG environment variable is used throughout build_loadup * Finish changing how RELEASE_TAG environment variable is used throughout build_loadup * Update abatilo/release-info-action to v1.3.2 to take care of ::set-output:: deprecation * Add commit to allow testing of release builds * Fix to Issue#1022 Error during greet * More fix to Issue#1022. Turns out need to reset MEDLEYDIR for AFTERMAKESYS as well as at greet time. Discovered during loadup-online.sh with no greet file. * Removing AFTERMAKESYS event action from (MEDLEY-INIT-VARS). Cleaning up a bit the GREET event action in (MEDLEY-INIT-VARS). Remove issue with MEDLEY-INIT-VARS being called after the user greet file in the AFTERMAKESYS case. --- .github/workflows/buildLoadup.yml | 79 ++++++++++++------------------- release_trigger | 1 + 2 files changed, 31 insertions(+), 49 deletions(-) create mode 100644 release_trigger diff --git a/.github/workflows/buildLoadup.yml b/.github/workflows/buildLoadup.yml index af777f5e..e9c4d8f9 100644 --- a/.github/workflows/buildLoadup.yml +++ b/.github/workflows/buildLoadup.yml @@ -1,4 +1,4 @@ -#re******************************************************************************* +#******************************************************************************* # buidLoadup.yml # # Interlisp workflow to build Medley release and push it to github. This workflow @@ -59,8 +59,8 @@ jobs: - id: force run: > if [ '${{ toJSON(inputs) }}' = 'null' ]; - then echo ::set-output name=force::'${{ github.event.inputs.force }}'; echo "workflow_dispatch"; - else echo ::set-output name=force::'${{ inputs.force }}'; echo "workflow_call"; + then echo "force=${{ github.event.inputs.force }}" >> $GITHUB_OUTPUT; echo "workflow_dispatch"; + else echo "force=${{ inputs.force }}" >> $GITHUB_OUTPUT; echo "workflow_call"; fi @@ -79,7 +79,7 @@ jobs: steps: # Checkout the actions for this repo owner - name: Checkout Actions - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: ${{ github.repository_owner }}/.github path: ./Actions_${{ github.sha }} @@ -110,7 +110,7 @@ jobs: steps: # Checkout the actions for this repo owner - name: Checkout Actions - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: ${{ github.repository_owner }}/.github path: ./Actions_${{ github.sha }} @@ -118,7 +118,7 @@ jobs: # Checkout latest commit - name: Checkout Medley - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Setup release tag - name: Setup Release Tag @@ -129,20 +129,20 @@ jobs: - name: Setup Environment Variables id: setup_env run: | - echo ::set-output name=build_time::$(date -u +'%Y-%m-%dT%H:%M:%SZ') + echo "build_time=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT # Get Maiko release information, retrieves the name of the latest # release. Used to download the correct Maiko release - name: Get Maiko Release Information id: latest_version - uses: abatilo/release-info-action@v1.3.0 + uses: abatilo/release-info-action@v1.3.2 with: owner: ${{ github.repository_owner }} repo: maiko # Download Maiko Release Assets - name: Download Release Assets - uses: robinraju/release-downloader@v1.2 + uses: robinraju/release-downloader@v1.6 with: repository: ${{ github.repository_owner }}/maiko token: ${{ secrets.GITHUB_TOKEN }} @@ -165,24 +165,20 @@ jobs: - name: Build loadups release tar run: | - cp -p tmp/full.sysout tmp/lisp.sysout tmp/whereis.hash loadups/ - cp -p tmp/exports.all library/ cd .. - tar cfz medley/tmp/${release_tag}-loadups.tgz \ + tar cfz medley/tmp/${RELEASE_TAG}-loadups.tgz \ medley/loadups/lisp.sysout \ medley/loadups/full.sysout \ medley/loadups/whereis.hash \ medley/library/exports.all - - env: - release_tag: ${{ steps.tag.outputs.release_tag }} - name: Build runtime release tar run: | cd .. - tar cfz medley/tmp/${release_tag}-runtime.tgz \ + tar cfz medley/tmp/${RELEASE_TAG}-runtime.tgz \ --exclude "*~" --exclude "*#*" \ --exclude exports.all \ + medley/clos \ medley/docs/dinfo \ medley/doctools \ medley/greetfiles \ @@ -197,40 +193,25 @@ jobs: medley/lispusers \ medley/sources \ medley/internal - env: - release_tag: ${{ steps.tag.outputs.release_tag }} - - - name: "Create release" - uses: "actions/github-script@v5" + - name: Delete existing release with same tag (if any) + uses: cb80/delrel@latest with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - script: | - try { - await github.rest.repos.createRelease({ - draft: false, - generate_release_notes: true, - name: process.env.release_tag, - owner: context.repo.owner, - prerelease: false, - repo: context.repo.repo, - tag_name: process.env.release_tag, - }); - } catch (error) { - core.setFailed(error.message); - } - env: - release_tag: ${{ steps.tag.outputs.release_tag }} - - - name: "Upload release assets" - uses: AButler/upload-release-assets@v2.0 - with: - files: 'tmp/${{ env.release_tag }}-loadups.tgz;tmp/${{ env.release_tag }}-runtime.tgz' - repo-token: ${{ secrets.GITHUB_TOKEN }} - release-tag: ${{ env.release_tag }} - env: - release_tag: ${{ steps.tag.outputs.release_tag }} + tag: ${{ env.RELEASE_TAG }} + continue-on-error: true + - name: Push the release + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: + tmp/${{ env.RELEASE_TAG }}-loadups.tgz, + tmp/${{ env.RELEASE_TAG }}-runtime.tgz + tag: ${{ env.RELEASE_TAG }} + draft: false + prerelease: false + generateReleaseNotes: true + token: ${{ secrets.GITHUB_TOKEN }} ###################################################################################### @@ -249,7 +230,7 @@ jobs: steps: # Checkout the actions for this repo owner - name: Checkout Actions - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: ${{ github.repository_owner }}/.github path: ./Actions_${{ github.sha }} @@ -265,6 +246,6 @@ jobs: - name: Output id: output run: | - echo ::set-output name=build_successful::'true' + echo "build_successful='true'" >> $GITHUB_OUTPUT ###################################################################################### diff --git a/release_trigger b/release_trigger new file mode 100644 index 00000000..52a0ec42 --- /dev/null +++ b/release_trigger @@ -0,0 +1 @@ +release trigger