mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
5d67d3c303
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 7. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
97 lines
2.6 KiB
YAML
97 lines
2.6 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
mode:
|
|
description: 'Run mode'
|
|
type: choice
|
|
options:
|
|
- snapshot
|
|
- release
|
|
default: snapshot
|
|
tag:
|
|
description: 'Release tag (required for release mode, e.g., v0.5.0)'
|
|
required: false
|
|
type: string
|
|
draft:
|
|
description: 'Publish as draft (release mode only)'
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
goreleaser:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Validate inputs
|
|
if: inputs.mode == 'release' && inputs.tag == ''
|
|
run: |
|
|
echo "::error::tag is required when mode=release"
|
|
exit 1
|
|
|
|
- name: Check out code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Set up Zig
|
|
uses: mlugg/setup-zig@v2
|
|
with:
|
|
version: 0.16.0
|
|
|
|
- name: Build ABE payload
|
|
run: make payload
|
|
|
|
- name: Create and push tag
|
|
if: inputs.mode == 'release'
|
|
env:
|
|
TAG: ${{ inputs.tag }}
|
|
run: |
|
|
if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null 2>&1; then
|
|
echo "::error::Tag '$TAG' already exists locally"
|
|
exit 1
|
|
fi
|
|
if git ls-remote --tags --exit-code origin "refs/tags/$TAG" >/dev/null 2>&1; then
|
|
echo "::error::Tag '$TAG' already exists on origin"
|
|
exit 1
|
|
fi
|
|
git tag -- "$TAG"
|
|
git push origin -- "$TAG"
|
|
|
|
- name: Run GoReleaser (snapshot)
|
|
if: inputs.mode == 'snapshot'
|
|
uses: goreleaser/goreleaser-action@v7
|
|
with:
|
|
version: '~> v2'
|
|
args: release --snapshot --clean
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
|
|
|
|
- name: Run GoReleaser (release)
|
|
if: inputs.mode == 'release'
|
|
uses: goreleaser/goreleaser-action@v7
|
|
with:
|
|
version: '~> v2'
|
|
args: release --clean ${{ inputs.draft && '--draft' || '' }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
|
|
|
|
- name: Upload snapshot artifacts
|
|
if: inputs.mode == 'snapshot'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: snapshot-dist
|
|
path: dist/
|
|
retention-days: 7
|