mirror of
https://github.com/google/go-jsonnet.git
synced 2025-08-12 09:17:11 +02:00
inject proposed version when running goreleaser
This commit is contained in:
parent
0558e35e56
commit
d1cde74e2c
25
.github/workflows/release.yml
vendored
25
.github/workflows/release.yml
vendored
@ -5,28 +5,35 @@ name: goreleaser
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
prerelease:
|
|
||||||
description: If set, publish this as a release candidate / prerelease version.
|
|
||||||
type: boolean
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
# Needed otherwise we get a shallow checkout by default.
|
||||||
|
# We need more so that goreleaser can find the previous version.
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.20
|
go-version: "1.20"
|
||||||
|
- name: Extract version
|
||||||
|
id: extract_version
|
||||||
|
run: |
|
||||||
|
CMD_VERSION="$(go run ./cmd/jsonnet --version | grep -oe 'v[0-9][0-9a-z.-]*$')" &&
|
||||||
|
printf "Extracted jsonnet version: %s\n" "${CMD_VERSION}" &&
|
||||||
|
git tag "${CMD_VERSION}" &&
|
||||||
|
printf "jsonnet_version='%s'\n" "${CMD_VERSION}" >> "${GITHUB_OUTPUT}"
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
|
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
|
||||||
|
env:
|
||||||
|
PROPOSED_VERSION: "${{ steps.extract_version.outputs.jsonnet_version }}"
|
||||||
|
GITHUB_TOKEN: "${{ github.token }}"
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: release --rm-dist
|
args: release --clean --draft
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
@ -96,6 +96,7 @@ checksum:
|
|||||||
release:
|
release:
|
||||||
draft: true
|
draft: true
|
||||||
skip_upload: false
|
skip_upload: false
|
||||||
|
target_commitish: "{{ .Env.PROPOSED_VERSION }}"
|
||||||
|
|
||||||
nfpms:
|
nfpms:
|
||||||
- id: jsonnet
|
- id: jsonnet
|
||||||
|
Loading…
Reference in New Issue
Block a user