bunkerweb/.github/workflows/push-github.yml
dependabot[bot] 23c5a2e92b
deps/gha: bump actions/checkout from 6.0.0 to 6.0.1
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](1af3b93b68...8e8c483db8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-03 08:08:48 +00:00

154 lines
6.9 KiB
YAML

name: Push on GitHub (REUSABLE)
on:
workflow_call:
inputs:
VERSION:
required: true
type: string
PRERELEASE:
required: true
type: boolean
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
# Generate checksum for install script
- name: Generate checksum for install script
run: |
cd misc
sha256sum install-bunkerweb.sh > install-bunkerweb.sh.sha256
# Get PDF doc
- name: Get documentation
if: inputs.VERSION != 'testing'
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: BunkerWeb_documentation_v${{ inputs.VERSION }}.pdf
# Create tag
- uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 # v1.7.2
name: Create tag
if: inputs.VERSION != 'testing'
with:
tag: "v${{ inputs.VERSION }}"
message: "v${{ inputs.VERSION }}"
force_push_tag: true
# Create tag
- uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 # v1.7.2
name: Create tag
if: inputs.VERSION == 'testing'
with:
tag: "${{ inputs.VERSION }}"
message: "${{ inputs.VERSION }}"
force_push_tag: true
# Extract and preserve changelog formatting
- name: Extract changelog
if: inputs.VERSION != 'testing'
run: |
# Extract the changelog content
VERSION="${{ inputs.VERSION }}"
# Check if this is a stable release (no -rc or -beta suffix)
if [[ ! "$VERSION" =~ -(rc|beta) ]]; then
# For stable releases, extract the stable section and all related RC/beta sections
# Extract major.minor.patch version (e.g., 1.6.5 from 1.6.5)
BASE_VERSION=$(echo "$VERSION" | grep -oP '^\d+\.\d+\.\d+')
# Find the line number of the current version header
start_line=$(grep -n "^## v${BASE_VERSION}" CHANGELOG.md | head -1 | cut -d: -f1)
# Find the line number of the next different version (not rc/beta of current version)
end_line=$(awk -v start="$start_line" -v base="$BASE_VERSION" '
NR > start && /^## v/ {
# Extract version from header
ver = $0
sub(/^## v/, "", ver)
sub(/ .*$/, "", ver)
sub(/-.*$/, "", ver)
if (ver != base) {
print NR
exit
}
}
' CHANGELOG.md)
# If no next version found, extract to end of file
if [ -z "$end_line" ]; then
content=$(awk -v start="$start_line" 'NR >= start' CHANGELOG.md | grep -v '# Changelog' | grep -v '##' | sed '/^$/d')
else
content=$(awk -v start="$start_line" -v end="$end_line" 'NR >= start && NR < end' CHANGELOG.md | grep -v '# Changelog' | grep -v '##' | sed '/^$/d')
fi
else
# For RC/beta releases, extract only the specific section
# Find the line number of the specific version header
start_line=$(grep -n "^## v${VERSION}" CHANGELOG.md | head -1 | cut -d: -f1)
# Find the line number of the next version header
end_line=$(awk -v start="$start_line" 'NR > start && /^## v/ {print NR; exit}' CHANGELOG.md)
# If no next version found, extract to end of file
if [ -z "$end_line" ]; then
content=$(awk -v start="$start_line" 'NR >= start' CHANGELOG.md | grep -v '# Changelog' | grep -v '##' | sed '/^$/d')
else
content=$(awk -v start="$start_line" -v end="$end_line" 'NR >= start && NR < end' CHANGELOG.md | grep -v '# Changelog' | grep -v '##' | sed '/^$/d')
fi
fi
echo "DECODED_CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$content" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
# Create release
- name: Create release
if: inputs.VERSION != 'testing'
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
body: |
Documentation : https://docs.bunkerweb.io/${{ inputs.VERSION }}/
Docker tags :
- BunkerWeb : `bunkerity/bunkerweb:${{ inputs.VERSION }}` or `ghcr.io/bunkerity/bunkerweb:${{ inputs.VERSION }}`
- Scheduler : `bunkerity/bunkerweb-scheduler:${{ inputs.VERSION }}` or `ghcr.io/bunkerity/bunkerweb-scheduler:${{ inputs.VERSION }}`
- Autoconf : `bunkerity/bunkerweb-autoconf:${{ inputs.VERSION }}` or `ghcr.io/bunkerity/bunkerweb-autoconf:${{ inputs.VERSION }}`
- UI : `bunkerity/bunkerweb-ui:${{ inputs.VERSION }}` or `ghcr.io/bunkerity/bunkerweb-ui:${{ inputs.VERSION }}`
Linux packages : https://packagecloud.io/app/bunkerity/bunkerweb/search?q=${{ inputs.VERSION }}&filter=all&dist=
Changelog :
${{ env.DECODED_CHANGELOG }}
draft: true
prerelease: ${{ inputs.PRERELEASE }}
name: v${{ inputs.VERSION }}
tag_name: v${{ inputs.VERSION }}
discussion_category_name: Announcements
files: |
BunkerWeb_documentation_v${{ inputs.VERSION }}.pdf
misc/install-bunkerweb.sh
misc/install-bunkerweb.sh.sha256
# Create release
- name: Create release
if: inputs.VERSION == 'testing'
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
body: |
**The testing version of BunkerWeb should not be used in production, please use the latest stable version instead.**
Documentation : https://docs.bunkerweb.io/${{ inputs.VERSION }}/
Docker tags :
- BunkerWeb : `bunkerity/bunkerweb:${{ inputs.VERSION }}` or `ghcr.io/bunkerity/bunkerweb:${{ inputs.VERSION }}`
- Scheduler : `bunkerity/bunkerweb-scheduler:${{ inputs.VERSION }}` or `ghcr.io/bunkerity/bunkerweb-scheduler:${{ inputs.VERSION }}`
- Autoconf : `bunkerity/bunkerweb-autoconf:${{ inputs.VERSION }}` or `ghcr.io/bunkerity/bunkerweb-autoconf:${{ inputs.VERSION }}`
- UI : `bunkerity/bunkerweb-ui:${{ inputs.VERSION }}` or `ghcr.io/bunkerity/bunkerweb-ui:${{ inputs.VERSION }}`
Linux packages : https://packagecloud.io/app/bunkerity/bunkerweb/search?q=${{ inputs.VERSION }}&filter=all&dist=
Please note that when using Linux Debian or Ubuntu integration, you will need to add the `force-bad-version` directive to your `/etc/dpkg/dpkg.cfg` file before installing the testing version of BunkerWeb.
draft: false
prerelease: ${{ inputs.PRERELEASE }}
name: Testing
tag_name: ${{ inputs.VERSION }}
files: |
misc/install-bunkerweb.sh
misc/install-bunkerweb.sh.sha256