Skip to content

fix(telnet): stop Mudlet masking all input for the whole session (#633) #26

fix(telnet): stop Mudlet masking all input for the whole session (#633)

fix(telnet): stop Mudlet masking all input for the whole session (#633) #26

Workflow file for this run

---
name: Prerelease
"on":
push:
branches:
- master
# The prerelease entry is intentionally rolling: each successful merge to master
# replaces the existing prerelease assets. The Git tags are unique per workflow
# attempt so normal developer fetches do not fail on a force-moved tag.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: read
env:
DATAFILES_ARCHIVE: gomud-ALL-datafiles.zip
CHECKSUMS_FILE: SHA256SUMS.txt
jobs:
metadata:
name: Read Binary Version
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: read
outputs:
binary_version: ${{ steps.meta.outputs.binary_version }}
steps:
# actions/checkout v6.0.3
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
persist-credentials: false
- name: Compute release metadata
id: meta
run: |
set -euo pipefail
binary_version="$(
awk -F'"' '/^const VERSION = "/ { print $2; exit }' main.go
)"
if [ -z "$binary_version" ]; then
echo "Could not determine binary version from main.go" >&2
exit 1
fi
echo "binary_version=${binary_version}" >> "$GITHUB_OUTPUT"
test:
name: Validate Release Source
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
steps:
# actions/checkout v6.0.3
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
persist-credentials: false
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/go-checks
build:
name: Build Release Binary (${{ matrix.label }})
runs-on: ubuntu-24.04
timeout-minutes: 20
needs:
- metadata
- test
strategy:
fail-fast: false
matrix:
include:
- label: Linux amd64
asset: gomud-linux_x64
- label: Linux arm64
asset: gomud-linux_arm64
- label: Linux arm/v7
asset: gomud-linux_armv7
- label: Windows amd64
asset: gomud-windows_x64.exe
- label: Windows arm64
asset: gomud-windows_arm64.exe
- label: macOS amd64
asset: gomud-darwin_x64
- label: macOS arm64
asset: gomud-darwin_arm64
permissions:
contents: read
env:
BINARY_VERSION: ${{ needs.metadata.outputs.binary_version }}
RELEASE_TARGET_ASSET: ${{ matrix.asset }}
steps:
# actions/checkout v6.0.3
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
persist-credentials: false
- uses: ./.github/actions/setup-go
- name: Build release binary
run: .github/scripts/build-release-binaries.sh
- name: Upload release binary
# actions/upload-artifact v7.0.1
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: release-binary-${{ matrix.asset }}
path: dist/${{ matrix.asset }}
if-no-files-found: error
publish:
name: Publish Rolling Prerelease
runs-on: ubuntu-24.04
timeout-minutes: 30
needs:
- metadata
- build
permissions:
contents: write
id-token: write
attestations: write
env:
RELEASE_TAG: prerelease-${{ github.run_id }}-${{ github.run_attempt }}
RELEASE_TAG_PREFIX: prerelease
RELEASE_TITLE: prerelease
BINARY_VERSION: ${{ needs.metadata.outputs.binary_version }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
# actions/checkout v6.0.3
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
persist-credentials: false
- name: Download release binaries
# actions/download-artifact v8.0.1
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
pattern: release-binary-*
path: bin/
merge-multiple: true
- name: Assemble release assets
run: .github/scripts/assemble-release-assets.sh
- name: Write release notes
env:
RELEASE_KIND: prerelease
RELEASE_NOTES_FILE: release-notes.md
run: .github/scripts/release-notes.sh
- name: Resolve attestation paths
id: release-assets
# Attest binaries and checksums. The datafiles zip is covered by the
# checksum file because it is assembled inside this workflow.
run: |
{
echo 'attestation_paths<<EOF'
.github/scripts/release-assets.sh attestation-paths
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Attest release assets
# actions/attest-build-provenance v4.1.0
# yamllint disable-line rule:line-length
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32
with:
subject-path: ${{ steps.release-assets.outputs.attestation_paths }}
- name: Publish rolling prerelease
run: |
set -euo pipefail
mapfile -t assets < <(
.github/scripts/release-assets.sh upload-paths
)
mapfile -t old_release_tags < <(
gh release list \
--limit 100 \
--json isPrerelease,tagName \
--jq '.[] | select(
.isPrerelease
and (
.tagName == "prerelease"
or (.tagName | startswith("prerelease-"))
)
) | .tagName'
)
gh release create "$RELEASE_TAG" \
"${assets[@]}" \
--title "$RELEASE_TITLE" \
--target "$GITHUB_SHA" \
--prerelease \
--latest=false \
--notes-file release-notes.md
for old_tag in "${old_release_tags[@]}"; do
if [ "$old_tag" = "$RELEASE_TAG" ]; then
continue
fi
gh release delete "$old_tag" --yes --cleanup-tag
done
# Remove a retired mutable prerelease tag even if it is not attached
# to a release anymore.
if gh api \
"repos/${GITHUB_REPOSITORY}/git/ref/tags/${RELEASE_TAG_PREFIX}" \
>/dev/null 2>&1; then
gh api \
-X DELETE \
"repos/${GITHUB_REPOSITORY}/git/refs/tags/${RELEASE_TAG_PREFIX}"
fi