Skip to content

Test - feat: fill version with git and ldflags #2

Test - feat: fill version with git and ldflags

Test - feat: fill version with git and ldflags #2

Workflow file for this run

# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Github Actions for Releases
on:
push:
tags:
- "*"
pull_request:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['1.18']
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Golang
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.version }}
check-latest: true
cache: true
- name: Build and package with GoReleaser for testing
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --clean
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
- name: Build and package with GoReleaser for deploy
if: startsWith(github.ref, 'refs/tags/')
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: --skip-publish
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
dist/checksums.txt
dist/*.tar.gz