Skip to content

feat: support environments (#9) #4

feat: support environments (#9)

feat: support environments (#9) #4

Workflow file for this run

on:
push:
tags:
- '*'
name: release
jobs:
Release:
runs-on: ubuntu-latest
env:
GO_VERSION: "1.21"
GOPRIVATE: gitlab.com/nitrado/*
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create .netrc
uses: extractions/netrc@v1
with:
machine: gitlab.com
username: ${{ secrets.GITLAB_USERNAME }}
password: ${{ secrets.GITLAB_TOKEN }}
- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSWORD }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
with:
version: latest
args: release --clean