Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add release action #36

Merged
merged 1 commit into from
Jan 6, 2024
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
12 changes: 12 additions & 0 deletions .github/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 1

builds:
- skip: true
env:
- CGO_ENABLED=0

changelog:
sort: asc
filters:
exclude:
- '^test:'
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: 'Release'

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

permissions:
contents: write

jobs:
goreleaser:
name: 'Release the latest tag'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean -f ${{ vars.GORELEASER_CONFIG_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.TOFUENV_GITHUB_TOKEN }}
- name: Download artifacts
uses: robinraju/[email protected]
with:
tag: ${{ github.ref_name }}
tarBall: true
zipBall: true
- name: Check contents
run: ls -la
- name: Generate checksum
uses: jmgilman/actions-generate-checksum@v1
with:
patterns: |
*.zip
*.tar.gz
method: sha256
output: checksums_${{ github.ref_name }}.txt
- name: Upload checksum to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.TOFUENV_GITHUB_TOKEN }}
file: checksums_${{ github.ref_name }}.txt
tag: ${{ github.ref_name }}