Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions .github/workflows/build.yml → .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
name: Build and Release
name: Go

on:
push:
release:
types: [published]

jobs:
release-please:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

build:
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -63,7 +77,11 @@ jobs:
- uses: actions/checkout@v6

- name: Set binary name
run: echo "BINARY_NAME=lfm-cli-${{ matrix.name }}-${{ github.ref_name }}${{ matrix.ext }}" >> $GITHUB_ENV
# Version comes from the const in main.go, which release-please keeps in
# sync; on a release-PR merge it already holds the version being tagged.
run: |
VERSION=$(sed -n 's/^const version = "\([^"]*\)".*/\1/p' main.go)
echo "BINARY_NAME=lfm-cli-${{ matrix.name }}-${VERSION}${{ matrix.ext }}" >> $GITHUB_ENV

- name: Set up Go
uses: actions/setup-go@v6
Expand All @@ -88,8 +106,8 @@ jobs:
path: lfm-cli-*

release:
needs: build
if: github.event_name == 'release'
needs: [release-please, build]
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -103,5 +121,6 @@ jobs:
- name: Upload to release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.release-please.outputs.tag_name }}
files: |
artifacts/lfm-cli-*
artifacts/lfm-cli-*
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.3.1"
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<p align="center">
<img src="https://img.shields.io/github/go-mod/go-version/twangodev/lfm-cli">
<img alt="GitHub all releases" src="https://img.shields.io/github/downloads/twangodev/lfm-cli/total">
<img src="https://img.shields.io/github/actions/workflow/status/twangodev/lfm-cli/build.yml?branch=main">
<img src="https://img.shields.io/github/actions/workflow/status/twangodev/lfm-cli/go.yml?branch=main">
<img src="https://img.shields.io/badge/Platforms-Windows%2C%20MacOS%2C%20Linux-orange">
<img src="https://img.shields.io/github/license/twangodev/lfm-cli">
</p>
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

const name = "lfm-cli"
const version = "v1.3.0"
const version = "v1.3.1" // x-release-please-version

const discordAppId = "970003417277812736"

Expand Down
9 changes: 9 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "go",
"extra-files": ["main.go"]
}
}
}
Loading