Skip to content

Commit

Permalink
feat: add goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsm-dev committed Sep 24, 2022
1 parent 347eae0 commit 278ac11
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/gr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: GoReleaser

on:
push:
tags:
- "*"

permissions:
contents: write

jobs:
goreleaser:
name: "GoReleaser"
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v3.0.2
with:
fetch-depth: 0

- name: Get Details
id: get_details
run: |
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=SOURCE_TAG::$(git tag --sort=committerdate | tail -1)
echo ::set-output name=GOVERSION::$(cat .go-version)
- name: List tags
run: |
git tag --list
- name: Show variables
run: |
echo $SOURCE_NAME
echo $SOURCE_BRANCH
echo $SOURCE_TAG
env:
SOURCE_NAME: ${{ steps.get_details.outputs.SOURCE_NAME }}
SOURCE_BRANCH: ${{ steps.get_details.outputs.SOURCE_BRANCH }}
SOURCE_TAG: ${{ steps.get_details.outputs.SOURCE_TAG }}

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ steps.get_details.outputs.GOVERSION }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
args: release --rm-dist
env:
CLIENT_VERSION: ${{ steps.get_details.outputs.SOURCE_TAG }}
GO_VERSION: ${{ steps.get_details.outputs.GOVERSION }}
GORELEASER_CURRENT_TAG: ${{ steps.get_details.outputs.SOURCE_TAG }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_BRANCH: ${{ steps.get_details.outputs.SOURCE_BRANCH }}

0 comments on commit 278ac11

Please sign in to comment.