Skip to content

v0.40 release

v0.40 release #7

name: Build and Publish Container Release
on:
push:
tags:
- 'v*.*'
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: mvn -B clean package
- name: Unzip Trimmomatic artifact
run: unzip -o target/Trimmomatic-*.zip
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version from tag
id: get_version
run: |
VERSION_TAG=${GITHUB_REF#refs/tags/}
echo "TAG=${VERSION_TAG}" >> $GITHUB_OUTPUT
echo "VERSION=${VERSION_TAG#v}" >> $GITHUB_OUTPUT
- name: Set repository name to lowercase
id: repo_lowercase
run: echo "NAME=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/${{ steps.repo_lowercase.outputs.NAME }}:${{ steps.get_version.outputs.TAG }}
build-args: |
TRIMMOMATIC_VERSION=${{ steps.get_version.outputs.VERSION }}