Skip to content

fix(ci): add timeout to fuzz smoke test to prevent context deadline e… #61

fix(ci): add timeout to fuzz smoke test to prevent context deadline e…

fix(ci): add timeout to fuzz smoke test to prevent context deadline e… #61

Workflow file for this run

name: Release
on:
push:
branches:
- main
workflow_dispatch:
inputs:
force:
description: "Re-release the current tag (use when a previous release partially failed)"
type: boolean
default: false
concurrency:
group: release
cancel-in-progress: false
permissions:
contents: write
jobs:
ci:
if: github.actor != 'sr-releaser[bot]'
uses: ./.github/workflows/ci.yml
release:
needs: ci
runs-on: ubuntu-latest
steps:
- name: Generate app token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.SR_RELEASER_APP_ID }}
private-key: ${{ secrets.SR_RELEASER_PRIVATE_KEY }}
repositories: ${{ github.event.repository.name }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- uses: urmzd/sr@v2
id: sr
with:
github-token: ${{ steps.app-token.outputs.token }}
force: ${{ inputs.force }}
outputs:
released: ${{ steps.sr.outputs.released }}
tag: ${{ steps.sr.outputs.tag }}
version: ${{ steps.sr.outputs.version }}
build:
needs: release
if: needs.release.outputs.released == 'true'
name: Build (${{ matrix.platform }})
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-latest
platform: linux
artifact: incipit-linux
- os: macos-latest
platform: darwin
artifact: incipit-darwin
- os: windows-latest
platform: windows
artifact: incipit.exe
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.release.outputs.tag }}
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build static CLI binary
shell: bash
run: |
CGO_ENABLED=0 go build -trimpath \
-ldflags "-X main.version=${{ needs.release.outputs.version }} -X main.commit=${{ github.sha }} -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
-o build/bin/${{ matrix.artifact }} ./cmd/incipit
- name: Upload to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: gh release upload "${{ needs.release.outputs.tag }}" "build/bin/${{ matrix.artifact }}" --clobber
bundle-templates:
needs: release
if: needs.release.outputs.released == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.release.outputs.tag }}
- name: Create templates tarball
run: tar czf templates.tar.gz -C templates --exclude='*.go' .
- name: Upload to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "${{ needs.release.outputs.tag }}" templates.tar.gz --clobber
update-assets:
needs: release
if: needs.release.outputs.released == 'true'
runs-on: ubuntu-latest
steps:
- name: Generate app token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.SR_RELEASER_APP_ID }}
private-key: ${{ secrets.SR_RELEASER_PRIVATE_KEY }}
repositories: ${{ github.event.repository.name }}
- uses: actions/checkout@v4
with:
ref: main
token: ${{ steps.app-token.outputs.token }}
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y ffmpeg ttyd tree
- name: Build CLI
run: CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o bin/incipit ./cmd/incipit
- name: Generate PDFs for showcase
run: |
mkdir -p showcase/pdfs
./bin/incipit generate assets/example_resumes/software_engineer.json -t modern-html -o showcase/build
find showcase/build -name '*.pdf' -exec sh -c 'cp "$1" showcase/pdfs/"$(echo "$1" | sed "s/.*\.\(.*\)\.pdf/\1.pdf/")"' _ {} \;
- name: Capture showcase assets
uses: urmzd/teasr@v0
- name: Commit assets to main
run: |
git config user.name "sr-releaser[bot]"
git config user.email "sr-releaser[bot]@users.noreply.github.com"
git add showcase/*.png showcase/*.gif
git diff --cached --quiet && exit 0
git commit -m "chore: update showcase assets [skip ci]"
git push origin HEAD:main