netmaker/.github/workflows/release-assets.yml

51 lines
1.4 KiB
YAML
Raw Normal View History

2023-02-21 05:01:17 +08:00
# generates release assets and uploads to release
2023-02-24 05:11:57 +08:00
name: Upload Release Assets
2023-02-21 05:01:17 +08:00
on:
workflow_call:
inputs:
version:
required: true
type: string
prerelease:
required: true
type: boolean
workflow_dispatch:
inputs:
version:
2023-02-23 09:28:20 +08:00
description: "netmaker version"
2023-02-21 05:01:17 +08:00
required: true
prerelease:
required: true
type: boolean
description: "prerelease"
2023-02-23 09:28:20 +08:00
jobs:
2023-02-21 05:01:17 +08:00
release-assets:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: release_${{ github.event.inputs.version}}
fetch-depth: 0
- name: Get Tags
run: |
git fetch --force --tags
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: GoReleaser (full release)
if: ${{ github.event.inputs.prerelease == 'false'}}
uses: goreleaser/goreleaser-action@v4
with:
args: release --clean --release-notes release.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: GoReleaser (prerelease)
if: ${{ github.event.inputs.prerelease == 'false'}}
uses: goreleaser/goreleaser-action@v4
with:
2023-02-24 05:11:57 +08:00
args: release --clean --release-notes release.md -f .goreleaser.prerelease.yaml
2023-02-21 05:01:17 +08:00
env:
2023-02-23 09:28:20 +08:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}