Skip to content

release: v1.0.4

release: v1.0.4 #5

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint and validate
run: npm run check
- name: Validate release metadata
run: npm run release:check -- "${GITHUB_REF_NAME}"
- name: Extract release notes
run: npm run changelog:extract -- "${GITHUB_REF_NAME}" > release-notes.md
- name: Compute release version
id: version
run: echo "value=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Create release archive
run: |
git archive \
--format=tar.gz \
--prefix="bzo-${{ steps.version.outputs.value }}/" \
-o "bzo-${{ steps.version.outputs.value }}.tar.gz" \
"$GITHUB_SHA"
- name: Compute image name
id: image
run: echo "name=ghcr.io/$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.image.outputs.name }}
tags: |
type=raw,value=${{ steps.version.outputs.value }}
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
body_path: release-notes.md
files: |
bzo-${{ steps.version.outputs.value }}.tar.gz