145 lines
4.1 KiB
YAML
145 lines
4.1 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-debian:
|
|
name: Build Debian 13
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: debian:13-slim
|
|
steps:
|
|
- name: Install dependencies
|
|
run: |
|
|
apt-get update && apt-get install -y git golang-go ca-certificates
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
- name: Build
|
|
run: go build -v -o gh-repo-bootstrap-linux-debian13-amd64 main.go
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gh-repo-bootstrap-linux-debian13-amd64
|
|
path: gh-repo-bootstrap-linux-debian13-amd64
|
|
|
|
build-arch:
|
|
name: Build Arch Linux
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: archlinux:latest
|
|
steps:
|
|
- name: Install dependencies
|
|
run: |
|
|
pacman -Syu --noconfirm git go ca-certificates
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
- name: Build
|
|
run: go build -v -o gh-repo-bootstrap-linux-arch-amd64 main.go
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gh-repo-bootstrap-linux-arch-amd64
|
|
path: gh-repo-bootstrap-linux-arch-amd64
|
|
|
|
build-fedora:
|
|
name: Build Fedora 44
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: fedora:44
|
|
steps:
|
|
- name: Install dependencies
|
|
run: |
|
|
dnf install -y git golang ca-certificates
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
- name: Build
|
|
run: go build -v -o gh-repo-bootstrap-linux-fedora44-amd64 main.go
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gh-repo-bootstrap-linux-fedora44-amd64
|
|
path: gh-repo-bootstrap-linux-fedora44-amd64
|
|
|
|
build-windows:
|
|
name: Build Windows
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.26.3'
|
|
- name: Build
|
|
run: go build -v -o gh-repo-bootstrap-windows-amd64.exe main.go
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gh-repo-bootstrap-windows-amd64.exe
|
|
path: gh-repo-bootstrap-windows-amd64.exe
|
|
|
|
build-macos:
|
|
name: Build macOS
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.26.3'
|
|
- name: Build
|
|
run: go build -v -o gh-repo-bootstrap-darwin-arm64 main.go
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gh-repo-bootstrap-darwin-arm64
|
|
path: gh-repo-bootstrap-darwin-arm64
|
|
|
|
release:
|
|
name: Create Release
|
|
needs: [build-debian, build-arch, build-fedora, build-windows, build-macos]
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: bin-artifacts
|
|
|
|
- name: Prepare Release Assets and Checksums
|
|
run: |
|
|
mkdir release-assets
|
|
find bin-artifacts -type f -exec cp {} release-assets/ \;
|
|
|
|
cd release-assets
|
|
echo "## SHA256 Checksums" > ../release_notes.txt
|
|
echo "" >> ../release_notes.txt
|
|
echo "| Filename | SHA256 Checksum |" >> ../release_notes.txt
|
|
echo "| --- | --- |" >> ../release_notes.txt
|
|
for file in *; do
|
|
sha=$(sha256sum "$file" | cut -d' ' -f1)
|
|
echo "| \`$file\` | \`$sha\` |" >> ../release_notes.txt
|
|
done
|
|
|
|
cat ../release_notes.txt
|
|
|
|
- name: Create GitHub Release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release create "${{ github.ref_name }}" \
|
|
--title "${{ github.ref_name }}" \
|
|
--notes-file release_notes.txt \
|
|
release-assets/*
|