Skip to content

Create plugin release #3

Create plugin release

Create plugin release #3

Workflow file for this run

name: Create plugin release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
is_draft_release:
description: "Whether a draft release should be created, instead of public one"
required: false
default: false
is_dry_run:
description: "Whether to create release"
required: false
default: false
golang_version:
description: "Golang version to use"
required: false
default: "1.22"
tag_name:
description: "Tag name to use for release"
required: true
jobs:
release-creation:
name: Automatic release creation triggered on ${{ github.ref_name }}
runs-on: ubuntu-latest
env:
# Whether to create release
IS_DRY_RUN: false
# Whether a draft release should be created, instead of public one
IS_DRAFT_RELEASE: false
PLUGIN_NAME: "honeycomb-metric-plugin"
GOLANG_VERSION: "1.22"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch tags
run: git fetch --tags --force
- name: Get current tag annotation
id: tag-data
uses: ericcornelissen/git-tag-annotation-action@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
body: ${{ steps.tag-data.outputs.git-tag-annotation }}
draft: ${{ env.IS_DRAFT_RELEASE }}
prerelease: false
- name: Set up Golang
uses: actions/setup-go@v4
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Build binaries
run: |
make release
- name: Upload linux/amd64 binary to release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/${{ PLUGIN_NAME }}-linux-amd64

Check failure on line 76 in .github/workflows/release.yaml

View workflow run for this annotation

GitHub Actions / Create plugin release

Invalid workflow file

The workflow is not valid. .github/workflows/release.yaml (Line: 76, Col: 23): Unrecognized named-value: 'PLUGIN_NAME'. Located at position 1 within expression: PLUGIN_NAME .github/workflows/release.yaml (Line: 77, Col: 23): Unrecognized named-value: 'PLUGIN_NAME'. Located at position 1 within expression: PLUGIN_NAME
asset_name: ${{ PLUGIN_NAME }}
asset_content_type: application/octet-stream
if: ${{ env.IS_DRY_RUN != 'true' }}
- name: Upload linux/arm64 binary to release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/${{ PLUGIN_NAME }}-linux-arm64
asset_name: ${{ PLUGIN_NAME }}
asset_content_type: application/octet-stream
if: ${{ env.IS_DRY_RUN != 'true' }}
- name: Upload darwin/amd64 binary to release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/${{ PLUGIN_NAME }}-darwin-amd64
asset_name: ${{ PLUGIN_NAME }}-darwin-amd64
asset_content_type: application/octet-stream
if: ${{ env.IS_DRY_RUN != 'true' }}
- name: Upload darwin/arm64 binary to release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/${{ PLUGIN_NAME }}-darwin-arm64
asset_name: ${{ PLUGIN_NAME }}
asset_content_type: application/octet-stream
if: ${{ env.IS_DRY_RUN != 'true' }}