Skip to content

Release

Release #11

Workflow file for this run

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-devtoolset7
- linux-armv6
- linux-armv7
- linux-armv7l-musl
- linux-arm64
- linux-arm64-lts
- linux-arm64-musl
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login
uses: docker/login-action@v2
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@v3
with:
context: ${{ matrix.image }}
tags: |
ghcr.io/prebuild/${{ matrix.image }}:latest
ghcr.io/prebuild/${{ matrix.image }}:${{ env.MAJOR }}
ghcr.io/prebuild/${{ matrix.image }}:${{ env.MINOR }}
ghcr.io/prebuild/${{ 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@v3
- name: Create GitHub release
uses: docker://antonyurchenko/git-release:v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}