Skip to content

Merge pull request #627 from sanger/depfu/update/npm/tailwindcss-3.4.17 #291

Merge pull request #627 from sanger/depfu/update/npm/tailwindcss-3.4.17

Merge pull request #627 from sanger/depfu/update/npm/tailwindcss-3.4.17 #291

# Automatically generate a release on devel, master and any branch prefixed
# with release.
# Note: This does *not* trigger the `release: published` action so will not
# cause the manual_build.yml action to fire.
# Github actions do not allow chaining actions triggered via the default
# secrets.GITHUB_TOKEN and instead would require the addition of a personal
# authentication token. See:
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token
# While we could go this route, it would require the addition of:
# 1) An automated 'bot' account to handle releases from the sanger/qunathub repo
# 2) Users to add the appropriate token to their forks if they want release behaviour.
# Instead I've opted to maintain separate automated and manual release actions.
# The two actions should remain in sync - Release building is the section from
#
# ## BUILD RELEASE
#
# onwards. Note that upload_url will differ between the two actions.
name: Automated Release and Build Project
on:
push:
branches:
- develop
- master
- release/* # Mostly for testing purposes.
jobs:
release:
name: Automated Release and Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Export node version
id: node_version
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- name: Set release tag
# Generate a release tag name in the format:
# develop/YYYY-MM-DD/HHMMSS
# Writes this out to the environment file for use downstream
run: echo "RELEASE_TAG=${GITHUB_REF#refs/heads/}/$(date +'%Y-%m-%d/%H%M%S')" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.RELEASE_TAG }}
release_name: Release ${{ env.RELEASE_TAG }}
draft: false
prerelease: ${{ !(github.ref == 'refs/heads/master') }}
## BUILD RELEASE
- name: Setup node
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
- name: Install
run: npm ci --legacy-peer-deps
- name: Compile build
run: ./compile-build.sh release.tar.gz dist
- name: Upload release.gz
id: upload-release-gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # Pull the URL from the event
asset_path: ./release.tar.gz
asset_name: release.tar.gz
asset_content_type: application/gzip