Skip to content

move to contrast-security-oss #1

move to contrast-security-oss

move to contrast-security-oss #1

Workflow file for this run

# this workflow releases the container images to ghcr.io
# trigger it by pushing a tag of the form v1.2.3
# Note - the push will fail if the CHANGELOG.md does not contain
# an entry for the version being released.
name: Release
on:
push:
tags: ['v[0-9]+.[0-9]+.[0-9]+']
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
image:
- alpine
# - android-armv7
# - android-arm64
- centos7
# - linux-armv6
# - linux-armv7
# - linux-armv7l-musl
- linux-arm64
# - linux-arm64-lts
# - linux-arm64-musl
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare tags
run: |
echo "MAJOR=$(echo ${GITHUB_REF/refs\/tags\/v/} | awk -F '.' '{print $1}')" >> $GITHUB_ENV
echo "MINOR=$(echo ${GITHUB_REF/refs\/tags\/v/} | awk -F '.' '{print $1"."$2}')" >> $GITHUB_ENV
echo "PATCH=$(echo ${GITHUB_REF/refs\/tags\/v/} | awk -F '.' '{print $1"."$2"."$3}')" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ matrix.image }}
tags: |
ghcr.io/contrast-security-oss/${{ matrix.image }}:latest
ghcr.io/contrast-security-oss/${{ matrix.image }}:${{ env.MAJOR }}
ghcr.io/contrast-security-oss/${{ matrix.image }}:${{ env.MINOR }}
ghcr.io/contrast-security-oss/${{ matrix.image }}:${{ env.PATCH }}
labels: |
org.opencontainers.image.version=${{ env.PATCH }}
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=GPL-3.0-only
push: true
release:
name: Release
needs: build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create GitHub release
uses: docker://antonyurchenko/git-release:v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}