Skip to content

ci: refactor

ci: refactor #1

Workflow file for this run

name: build
permissions:
contents: write
on:
push:
tags:
- 'v*'
branches:
- '**'
paths:
- '.github/workflows/meta.yml'
- '.github/workflows/build.yml'
- 'assets/**'
pull_request:
branches:
- '**'
paths:
- '.github/workflows/meta.yml'
- '.github/workflows/build.yml'
- 'assets/**'
workflow_dispatch:
jobs:
meta:
uses: ./.github/workflows/meta.yml
build:
needs: meta
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go modules
run: |
go mod download
# release:
# if: ${{ needs.meta.outputs.is_release == 'true' }}
# needs: [meta, build]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v4
# with:
# path: assets
# - run: |
# mv -vf assets/changelog/* .
# rm -rf assets/changelog
# cd assets
# for f in *; do
# (cd $f && zip -r ../$f-${{ needs.meta.outputs.tag }}.zip .)
# done
# - uses: softprops/action-gh-release@v1
# with:
# body_path: CHANGELOG.md
# files: assets/*
# tag_name: ${{ needs.meta.outputs.tag }}