Skip to content

Merge pull request #289 from umccr/bugfix/update-wrapica-and-icav2-cl… #69

Merge pull request #289 from umccr/bugfix/update-wrapica-and-icav2-cl…

Merge pull request #289 from umccr/bugfix/update-wrapica-and-icav2-cl… #69

name: Create and Upload Release And Docker Container(s)
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e v1.0, v20.15.10 etc
- 'pre-v*' # Push events to matching pre-v, i.ve pre-v1.0, pre-v20.15.10
- 'latest'
jobs:
# First job
build_release:
name: Build Release Bundle
runs-on: ubuntu-latest
steps:
# Standard checkout step
- name: Checkout code
id: git_checkout
uses: actions/checkout@v4
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
# Get tag name, from /ref/heads/<tag> to <tag>
- name: Get Tag Name
id: get_tag_name
run: echo "tag_name=$(basename ${{ github.ref }})" >> "${GITHUB_OUTPUT}"
# Is pre-release?
- name: Determine if this is a pre-release or not
id: is_prerelease
run: echo "prerelease=$(if [[ "${{ steps.get_tag_name.outputs.tag_name }}" == "pre"* || "${{ steps.get_tag_name.outputs.tag_name }}" == "dev" ]]; then echo true; else echo false; fi)" >> "${GITHUB_OUTPUT}"
# Build project
- name: Build project # This would actually build your project, using zip for an example artifact
uses: ./.github/actions/build-release
with:
git_tag: ${{ steps.get_tag_name.outputs.tag_name }}
# Create release zip file
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_tag_name.outputs.tag_name }}
name: release-${{ steps.get_tag_name.outputs.tag_name }}
draft: false
body: ${{ github.event.head_commit.message }}
prerelease: ${{ steps.is_prerelease.outputs.prerelease == 'true' }}
files: |
release-${{ steps.get_tag_name.outputs.tag_name }}.zip
# Second job - can be run in parallel to building release
build_container:
name: Build Container
runs-on: ubuntu-latest
steps:
# Standard checkout step
- name: Checkout code
id: git_checkout
uses: actions/checkout@v4
# Use qemu to perform multiplatform builds
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# Use docker buildx to build multi-platform containers
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
use: true
install: true
buildkitd-config-inline: |
[worker.oci]
max-parallelism = 2
# Log in to GitHub Container registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push docker images
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: ./
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository }}:latest