Skip to content

Commit

Permalink
ci(layout): use latest craft generation
Browse files Browse the repository at this point in the history
Signed-off-by: kilianpaquier <[email protected]>
  • Loading branch information
kilianpaquier committed Oct 27, 2024
1 parent 9cbc658 commit 35d8c51
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/actions/version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ runs:
fi
env:
MODE: ${{ inputs.mode }}
- uses: actions/download-artifact@v4
if: ${{ inputs.download_dist == 'true' }}
- if: ${{ inputs.download_dist == 'true' }}
uses: actions/download-artifact@v4
with:
name: build
path: dist
Expand Down
5 changes: 1 addition & 4 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ autolabeler:
- label: javascript
files:
- "**/*.js"
- "**/*.ts"

- label: python
files:
Expand All @@ -79,10 +80,6 @@ autolabeler:
- "**/*.zsh"
- "**/*.bash"

- label: typescript
files:
- "**/*.ts"

- label: dependencies
title:
- /.*\(deps\).*/
Expand Down
54 changes: 39 additions & 15 deletions .github/workflows/integration.yml → .github/workflows/golang.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Code generated by craft; DO NOT EDIT.

name: Integration
run-name: Integration
name: Golang
run-name: Golang

on:
pull_request:
Expand All @@ -17,12 +17,18 @@ on:
- dev
- develop
- development
- main
- master
- next
- staging
- v[0-9]+.[0-9]+.x
- v[0-9]+.x
workflow_call:
inputs:
build:
description: Whether to run build job or not
required: false
type: boolean
version:
description: Build version to use in build metadata
required: true
type: string
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -89,8 +95,8 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- run: mkdir -p reports/
- run: go test ./... -coverpkg="./..." -covermode="count" -coverprofile="reports/go-coverage.native.out" -timeout=15s
- uses: codecov/codecov-action@v4
if: ${{ ! startsWith(github.head_ref, 'dependabot') }} # ignore codecov on dependabot branches
- if: ${{ ! startsWith(github.head_ref, 'dependabot') }} # ignore codecov on dependabot branches
uses: codecov/codecov-action@v4
with:
codecov_yml_path: .codecov.yml
disable_search: true
Expand All @@ -101,15 +107,33 @@ jobs:
slug: ${{ github.repository }}
token: ${{ secrets.CODECOV_TOKEN }}

workflow-result:
name: Workflow Result
go-build:
name: Go Build
runs-on: ubuntu-latest
if: ${{ needs.run-workflow.outputs.skip == 'false' && ! cancelled() }}
if: ${{ inputs.build }}
needs:
- run-workflow
- go-vulncheck
- go-lint
- go-test
steps:
- run: exit 1
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: go.mod
token: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/marketplace/actions/goreleaser-action
- uses: goreleaser/goreleaser-action@v6
with:
args: release --clean --config .goreleaser.yml --skip=validate --skip=announce --skip=publish --snapshot
env:
VERSION: ${{ inputs.version }}
- uses: actions/upload-artifact@v4
with:
name: build
# order is important to filter unwanted globs after the filter or desired globs
path: |
dist/*
!dist/*.json
!dist/*.yaml
!dist/*/
retention-days: 1
14 changes: 9 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
version:
name: Version
runs-on: ubuntu-latest
if: ${{ github.ref_protected }} # skip all jobs since they depend on version job
if: ${{ github.ref_protected }}
environment: release
permissions:
contents: write
Expand All @@ -52,12 +52,16 @@ jobs:
env:
INPUT_MODE: ${{ inputs.mode }}

build:
name: Build
golang:
name: Golang
needs: version
uses: ./.github/workflows/build.yml
uses: ./.github/workflows/golang.yml
permissions:
checks: write
with:
build: true
version: ${{ needs.version.outputs.version }}
secrets: inherit

release:
name: Release
Expand All @@ -69,7 +73,7 @@ jobs:
pull-requests: write
needs:
- version
- build
- golang
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/version
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# go-builder-generator <!-- omit in toc -->

<p align="center">
<img alt="GitHub Actions" src="https://img.shields.io/github/actions/workflow/status/kilianpaquier/go-builder-generator/integration.yml?branch=main&style=for-the-badge">
<img alt="GitHub Release" src="https://img.shields.io/github/v/release/kilianpaquier/go-builder-generator?include_prereleases&sort=semver&style=for-the-badge">
<img alt="GitHub Issues" src="https://img.shields.io/github/issues-raw/kilianpaquier/go-builder-generator?style=for-the-badge">
<img alt="GitHub License" src="https://img.shields.io/github/license/kilianpaquier/go-builder-generator?style=for-the-badge">
Expand All @@ -20,11 +19,7 @@
- [Commands](#commands)
- [Generate](#generate)
- [Upgrade](#upgrade)
- [Tags](#tags)
- [Generation cases](#generation-cases)
- [Simple struct](#simple-struct)
- [Generic struct](#generic-struct)
- [Imported module struct](#imported-module-struct)

## How to use ?

Expand Down

0 comments on commit 35d8c51

Please sign in to comment.