Skip to content

cd / binaries

cd / binaries #579

Workflow file for this run

name: cd / binaries
on:
push:
tags:
- v*
workflow_run:
workflows:
- ci / core
types:
- completed
branches:
- main
workflow_dispatch:
jobs:
prepare:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
outputs:
release-name: ${{ steps.release-name.outputs.release-name }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: release-name
run: |
RELEASE_NAME=${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '$(git describe --tags)' }}
echo "release-name=$(echo ${RELEASE_NAME#v} | sed 's/-/+/')" >>$GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: [prepare]
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.19"
cache: true
- run: sudo apt-get update && sudo apt-get install -y checkpolicy semodule-utils
- uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --rm-dist --snapshot=${{ !startsWith(github.ref, 'refs/tags/') }}
env:
RELEASE_NAME: ${{ needs.prepare.outputs.release-name }}
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
GEMFURY_TOKEN: ${{ secrets.GORELEASER_GEMFURY_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: binaries
path: dist/