Skip to content

Commit

Permalink
Try stock Github actions instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
marianogappa committed Jun 23, 2024
1 parent 6b4d765 commit 5f2c674
Showing 1 changed file with 24 additions and 35 deletions.
59 changes: 24 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,34 @@
name: Release
name: goreleaser

on:
pull_request:
push:
branches:
- main

permissions:
contents: write

jobs:
release:
name: Release with GoReleaser
goreleaser:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v3
-
name: Checkout
uses: actions/checkout@v4
with:
go-version: '1.22.3'

- name: Install GoReleaser
run: |
curl -sSfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh
- name: Calculate next minor version
id: next-version
run: |
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
major=$(echo $latest_tag | cut -d'.' -f1)
minor=$(echo $latest_tag | cut -d'.' -f2)
new_minor=$((minor + 1))
echo "next_version=${major}.${new_minor}.0" >> $GITHUB_ENV
- name: Create tag
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag ${{ env.next_version }}
git push origin ${{ env.next_version }}
- name: Run GoReleaser
run: goreleaser release --rm-dist
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v5
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
# 'latest', 'nightly', or a semver
version: 'latest'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

0 comments on commit 5f2c674

Please sign in to comment.