Skip to content

fix(bot): skip deleting absent Telegram webhook #3

fix(bot): skip deleting absent Telegram webhook

fix(bot): skip deleting absent Telegram webhook #3

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: read
jobs:
verify:
name: Verify Release Candidate
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: '1.26.7'
- name: Verify dependencies and generated module files
shell: bash
run: |
go mod verify
unformatted="$(git ls-files -z '*.go' | xargs -0 gofmt -l)"
test -z "${unformatted}"
go mod tidy
git diff --exit-code -- go.mod go.sum
- name: Run static analysis
run: |
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@v0.8.1 ./...
- name: Run tests with the race detector
run: go test -race ./...
- name: Scan reachable dependencies for vulnerabilities
run: go run golang.org/x/vuln/cmd/govulncheck@v1.7.0 ./...
release:
name: Build and Publish Release
runs-on: ubuntu-latest
needs: verify
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: '1.26.7'
check-latest: true
- name: Build and Package Multi-Platform Binaries
env:
TAG_NAME: ${{ github.ref_name }}
run: |
mkdir -p dist
PLATFORMS=(
"linux/amd64"
"linux/arm64"
"linux/arm/7"
"linux/arm/6"
"linux/386"
"darwin/amd64"
"darwin/arm64"
"windows/amd64"
"windows/arm64"
"windows/386"
"freebsd/amd64"
)
for PLATFORM in "${PLATFORMS[@]}"; do
IFS="/" read -r OS ARCH EXTRA <<< "${PLATFORM}"
BIN_NAME="transmission-telegram"
ARCHIVE_NAME="transmission-telegram_${TAG_NAME}_${OS}_${ARCH}"
export GOOS=${OS}
export GOARCH=${ARCH}
export CGO_ENABLED=0
if [ -n "${EXTRA}" ]; then
export GOARM=${EXTRA}
ARCHIVE_NAME="transmission-telegram_${TAG_NAME}_${OS}_${ARCH}v${EXTRA}"
else
unset GOARM
fi
BUILD_DIR="build_${OS}_${ARCH}${EXTRA}"
mkdir -p "${BUILD_DIR}"
TARGET_BIN="${BUILD_DIR}/${BIN_NAME}"
if [ "${OS}" = "windows" ]; then
TARGET_BIN="${TARGET_BIN}.exe"
fi
echo "Building ${OS}/${ARCH}${EXTRA}..."
go build -trimpath -ldflags="-s -w -X github.com/pyed/transmission-telegram/internal/config.Version=${TAG_NAME}" -o "${TARGET_BIN}" ./cmd/bot/
cp README.md LICENSE "${BUILD_DIR}/"
if [ "${OS}" = "windows" ]; then
(cd "${BUILD_DIR}" && zip -r "../dist/${ARCHIVE_NAME}.zip" .)
else
tar -czf "dist/${ARCHIVE_NAME}.tar.gz" -C "${BUILD_DIR}" .
fi
rm -rf "${BUILD_DIR}"
done
# Generate SHA-256 Checksums
cd dist
sha256sum * > "checksums.txt"
cd ..
- name: Create GitHub Release
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2
with:
files: |
dist/*.tar.gz
dist/*.zip
dist/checksums.txt
generate_release_notes: true
draft: false
prerelease: false