Skip to content

v0.8.1

v0.8.1 #24

Workflow file for this run

name: Create fail2ban-dashboard release
on:
release:
types: [published]
permissions:
contents: write
env:
CGO_ENABLED: 0
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Show tag
run: echo "Building for release ${{ github.event.release.tag_name }}"
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Display Go version
run: go version
- name: Test
run: |
make test
- name: Build
run: |
VERSION_INPUT=${{ github.event.release.tag_name }}
CURRENT_VERSION=${VERSION_INPUT:-"ci"}
make build VERSION=$CURRENT_VERSION
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.9.0
- name: Upload build result
uses: actions/upload-artifact@v4
with:
name: build_result
path: bin/**
retention-days: 1
build-and-push-image:
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout repository
uses: actions/checkout@v4
- name: Retrieve artifacts
uses: actions/download-artifact@v4
with:
pattern: build_result
merge-multiple: true
path: bin
- name: Display structure of downloaded files
run: ls -hR
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository_owner }}/fail2ban-dashboard:${{ github.event.release.tag_name }},ghcr.io/${{ github.repository_owner }}/fail2ban-dashboard:latest
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
update-release:
runs-on: ubuntu-latest
needs: ["build", "build-and-push-image"]
steps:
- name: Retrieve artifacts
uses: actions/download-artifact@v4
with:
pattern: build_result
merge-multiple: true
path: bin
- name: Display structure of downloaded files
run: ls -hR
- name: Create compressed archives
run: |
# Create tar.gz archive
cd bin && tar -czf ../fail2ban-dashboard-${{ github.event.release.tag_name }}-linux-amd64.tar.gz . && cd ..
sha256sum fail2ban-dashboard-${{ github.event.release.tag_name }}-linux-amd64.tar.gz >> SHA256SUMS
cat SHA256SUMS
- name: Display created files
run: ls -hR
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.release.tag_name }}
append_body: true
body: |
## Binary Downloads
The compiled binary for Linux (amd64) is attached to this release as compressed archives.
## Docker Container
Docker images are available at:
- **Tagged version**: `ghcr.io/${{ github.repository_owner }}/fail2ban-dashboard:${{ github.event.release.tag_name }}`
- **Latest version**: `ghcr.io/${{ github.repository_owner }}/fail2ban-dashboard:latest`
files: |
**/*.tar.gz
SHA256SUMS