Skip to content

Commit

Permalink
Setup release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bezbac committed Mar 17, 2024
1 parent 4c25598 commit acd55ab
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
push:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
# Push events to any matching semantic version tag.
# For example, 1.10.1 or 2.0.0 or 3.0.0-alpha.

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -55,6 +59,9 @@ jobs:
tags: |
type=sha
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: "Check"
on:
workflow_dispatch:
push:
paths:
- flake.nix
- .github/workflows/check.yaml

jobs:
check-nix:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
# Push events to any matching semantic version tag.
# For example, 1.10.1 or 2.0.0 or 3.0.0-alpha.

jobs:
release:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Wait for tests to succeed
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: "build-and-push"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 20

- name: Build changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
configuration: "release-changelog-builder-config.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
name: Release ${{ github.ref }}
body: ${{steps.changelog.outputs.changelog}}
draft: false
prerelease: false

0 comments on commit acd55ab

Please sign in to comment.