1
0
mirror of synced 2026-01-20 10:14:25 +00:00
Frank Halasz 62754015b0
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.
2022-11-26 15:05:45 -08:00

252 lines
8.2 KiB
YAML

#*******************************************************************************
# buidLoadup.yml
#
# Interlisp workflow to build Medley release and push it to github. This workflow
# is platform independent - but runs on Linux/amd64.
#
# This workflow contains a sentry that causes it to skip the build (as identified
# by its commit SHA) if its already been done. Setting the "force" input to true
# will bypass this sentry,
#
# 2022-01-17 Frank Halasz based on an earlier version of buildLoadup for Medley.
#
# Copyright 2022 by Interlisp.org
#
# ******************************************************************************
name: Build/Push Medley Release
# Run this workflow on ...
on:
workflow_dispatch:
inputs:
force:
description: "Force build even if build already successfully completed for this commit"
type: choice
options:
- 'false'
- 'true'
workflow_call:
outputs:
successful:
description: "'True' if medley build completed successully"
value: ${{ jobs.complete.outputs.build_successful }}
inputs:
force:
description: "Force build even if build already successfully completed for this commit"
required: false
type: string
default: 'false'
defaults:
run:
shell: bash
jobs:
######################################################################################
# Regularize the inputs so they can be referenced the same way whether they are
# the result of a workflow_dispatch or a workflow_call
inputs:
runs-on: ubuntu-latest
outputs:
force: ${{ steps.force.outputs.force }}
steps:
- id: force
run: >
if [ '${{ toJSON(inputs) }}' = 'null' ];
then echo "force=${{ github.event.inputs.force }}" >> $GITHUB_OUTPUT; echo "workflow_dispatch";
else echo "force=${{ inputs.force }}" >> $GITHUB_OUTPUT; echo "workflow_call";
fi
######################################################################################
# Use sentry-action to determine if this release has already been built
# based on the latest commit to the repo
sentry:
needs: inputs
runs-on: ubuntu-latest
outputs:
release_not_built: ${{ steps.check.outputs.release_not_built }}
steps:
# Checkout the actions for this repo owner
- name: Checkout Actions
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/.github
path: ./Actions_${{ github.sha }}
- run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }}
# Check if build already run for this commit
- name: Build already completed?
id: check
continue-on-error: true
uses: ./../actions/check-sentry-action
with:
tag: "loadup"
######################################################################################
# Do the loadup
#
loadup:
runs-on: ubuntu-latest
needs: [inputs, sentry]
if: |
needs.sentry.outputs.release_not_built == 'true'
|| needs.inputs.outputs.force == 'true'
steps:
# Checkout the actions for this repo owner
- name: Checkout Actions
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/.github
path: ./Actions_${{ github.sha }}
- run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }}
# Checkout latest commit
- name: Checkout Medley
uses: actions/checkout@v3
# Setup release tag
- name: Setup Release Tag
id: tag
uses: ./../actions/release-tag-action
# Setup environment variables
- name: Setup Environment Variables
id: setup_env
run: |
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.2
with:
owner: ${{ github.repository_owner }}
repo: maiko
# Download Maiko Release Assets
- name: Download Release Assets
uses: robinraju/release-downloader@v1.6
with:
repository: ${{ github.repository_owner }}/maiko
token: ${{ secrets.GITHUB_TOKEN }}
latest: true
fileName: "${{ steps.latest_version.outputs.latest_tag }}-linux.x86_64.tgz"
- name: Untar Maiko Release
run: |
tar -xvzf "${{ steps.latest_version.outputs.latest_tag }}-linux.x86_64.tgz"
- name: Install vnc
run: sudo apt-get update && sudo apt-get install -y tightvncserver
- name: Build Loadout
run: |
Xvnc -geometry 1280x720 :0 &
export DISPLAY=":0"
PATH="$PWD/maiko:$PATH"
scripts/loadup-all.sh
- name: Build loadups release tar
run: |
cd ..
tar cfz medley/tmp/${RELEASE_TAG}-loadups.tgz \
medley/loadups/lisp.sysout \
medley/loadups/full.sysout \
medley/loadups/whereis.hash \
medley/library/exports.all
- name: Build runtime release tar
run: |
cd ..
tar cfz medley/tmp/${RELEASE_TAG}-runtime.tgz \
--exclude "*~" --exclude "*#*" \
--exclude exports.all \
medley/clos \
medley/docs/dinfo \
medley/doctools \
medley/greetfiles \
medley/rooms \
medley/run-medley \
medley/scripts \
medley/fonts/displayfonts \
medley/fonts/altofonts \
medley/fonts/adobe \
medley/fonts/postscriptfonts \
medley/library \
medley/lispusers \
medley/sources \
medley/internal
- name: Delete existing release with same tag (if any)
uses: cb80/delrel@latest
with:
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 }}
######################################################################################
# Use set-sentry-action to determine set the sentry that says this release has
# been successfully built
complete:
runs-on: ubuntu-latest
outputs:
build_successful: ${{ steps.output.outputs.build_successful }}
needs: [inputs, sentry, loadup]
steps:
# Checkout the actions for this repo owner
- name: Checkout Actions
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/.github
path: ./Actions_${{ github.sha }}
- run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }}
# Set sentry
- name: Set flag that build for this commit has been completed
id: set
uses: ./../actions/set-sentry-action
with:
tag: "loadup"
- name: Output
id: output
run: |
echo "build_successful='true'" >> $GITHUB_OUTPUT
######################################################################################