Files
atlantis/.github/workflows/release.yml
StepSecurity Bot 5e4a35b596 ci: [StepSecurity] Apply security best practices (#5271)
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
Signed-off-by: Rui Chen <rui@chenrui.dev>
Co-authored-by: RB <7775707+nitrocode@users.noreply.github.com>
Co-authored-by: Rui Chen <rui@chenrui.dev>
2025-01-24 23:45:00 -05:00

49 lines
1.4 KiB
YAML

name: release
on:
push:
tags:
- v*.*.*
workflow_dispatch:
jobs:
goreleaser:
runs-on: ubuntu-24.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
submodules: true
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5
with:
go-version-file: go.mod
- name: Run GoReleaser for stable release
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6
if: (!contains(github.ref, 'pre'))
with:
# You can pass flags to goreleaser via GORELEASER_ARGS
# --clean will save you deleting the dist dir
args: release --clean
distribution: goreleaser # or 'goreleaser-pro'
version: "~> v2" # or 'latest', 'nightly', semver
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate changelog for pre release
if: contains(github.ref, 'pre')
id: changelog
run: |
echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
gh api repos/$GITHUB_REPOSITORY/releases/generate-notes \
-f tag_name="${GITHUB_REF#refs/tags/}" \
-f target_commitish=main \
-q .body > tmp-CHANGELOG.md
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}