Skip to content

Update installation and post-installation details in README #62

Update installation and post-installation details in README

Update installation and post-installation details in README #62

Workflow file for this run

name: Build and Create Release
permissions:
"contents": "write"
"id-token": "write"
on:
push:
branches:
- main
tags:
- '**[0-9]+.[0-9]+.[0-9]+*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.24.5'
- name: Install dependencies
run: go mod download
- name: Build
run: |
go build -o zoraxycrowdsecbouncer
chmod +x zoraxycrowdsecbouncer
- name: generate checksums
run: |
sha256sum zoraxycrowdsecbouncer > zoraxycrowdsecbouncer.sha256
sha256sum config.yaml > config.yaml.sha256
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: zoraxycrowdsecbouncer
path: zoraxycrowdsecbouncer
- name: Upload config artifact
uses: actions/upload-artifact@v4
with:
name: config.yaml
path: config.yaml
- name: Upload binary checksum artifact
uses: actions/upload-artifact@v4
with:
name: zoraxycrowdsecbouncer.sha256
path: zoraxycrowdsecbouncer.sha256
- name: Upload config checksum artifact
uses: actions/upload-artifact@v4
with:
name: config.yaml.sha256
path: config.yaml.sha256
- name: Create release body
id: release_body
run: |
echo "# Release notes for ${{ github.ref_name }}" > release_notes.txt
echo "Build date: $(date)" >> release_notes.txt
echo "Go version: $(go version)" >> release_notes.txt
echo "Commit SHA: ${{ github.sha }}" >> release_notes.txt
echo "| File | SHA256 Checksum |" >> release_notes.txt
echo "| --- | --- |" >> release_notes.txt
echo "| zoraxycrowdsecbouncer | \`$(sha256sum zoraxycrowdsecbouncer | awk '{print $1}')\` |" >> release_notes.txt
echo "| config.yaml | \`$(sha256sum config.yaml | awk '{print $1}')\` |" >> release_notes.txt
echo "BODY<<EOF" >> $GITHUB_OUTPUT
cat release_notes.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: false
prerelease: true
generate_release_notes: true
body: ${{ steps.release_body.outputs.BODY }}
files: |
zoraxycrowdsecbouncer
config.yaml
zoraxycrowdsecbouncer.sha256
config.yaml.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}