Skip to content

github ci

github ci #2

Workflow file for this run

name: Build
on:
workflow_dispatch:
push:
paths-ignore:
- "README.md"
branches:
- main
- dev
tags:
- "v*"
pull_request_target:
branches:
- main
- dev
jobs:
build:
permissions: write-all
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
fail-fast: false
defaults:
run:
shell: bash
working-directory: .
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set variables
if: ${{github.ref_name=='main'}}
run: echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Set variables
if: ${{github.ref_name=='' || github.ref_type=='tag'}}
run: echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.23.0"
check-latest: true
- name: Install UPX
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- name: Build govm
run: make all
- name: Upload Release
if: ${{ success() && github.ref_type=='tag' }}
uses: softprops/action-gh-release@v1
with:
tag: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
files: bin/govm-*
generate_release_notes: true