Skip to content

Commit

Permalink
ci(release): refactor release workflow
Browse files Browse the repository at this point in the history
ci(release-publish): remove docker packaging job

also download the PGO file artifact, if doesn't
exists, make it

Signed-off-by: Dwi Siswanto <[email protected]>

ci: rename release-publish workflow

Signed-off-by: Dwi Siswanto <[email protected]>

ci(release): rm job input && cond expr

Signed-off-by: Dwi Siswanto <[email protected]>

ci(release): rm tag input && add if ref type is tag

Signed-off-by: Dwi Siswanto <[email protected]>

ci(release): seperate is-tag as a job

Signed-off-by: Dwi Siswanto <[email protected]>

revert: "ci(release): rm tag input && add if ref type is tag"

Signed-off-by: Dwi Siswanto <[email protected]>

ci(release): update tag input desc

Signed-off-by: Dwi Siswanto <[email protected]>

ci(release): fix build PGO file expr

Signed-off-by: Dwi Siswanto <[email protected]>

ci(release): build PGO file on failure only

ci(release): update build PGO file script

Signed-off-by: Dwi Siswanto <[email protected]>

ci(release): build PGO file on failure only

Signed-off-by: Dwi Siswanto <[email protected]>

ci(generate-pgo): make pgo

Signed-off-by: Dwi Siswanto <[email protected]>

ci(release): `continue-on-error` while `download-artifact`

Signed-off-by: Dwi Siswanto <[email protected]>

build: fix seq & key indents in goreleaser config

Signed-off-by: Dwi Siswanto <[email protected]>

ci(release): make PGO with POSIX-comp script

coz we are on container

Signed-off-by: Dwi Siswanto <[email protected]>
  • Loading branch information
dwisiswant0 committed Mar 23, 2024
1 parent 2d11879 commit ded3754
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 74 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/generate-pgo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
PGO_BRANCH: "pgo"

jobs:
tests:
generate-pgo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -24,7 +24,7 @@ jobs:
go-version-file: 'go.mod'
cache-dependency-path: '**/go.sum'

- run: make pprof && cp ${{ env.PGO_FILE }} /tmp/
- run: make pgo && cp ${{ env.PGO_FILE }} /tmp/

- uses: actions/checkout@v3
with:
Expand Down
63 changes: 0 additions & 63 deletions .github/workflows/release-publish.yaml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
push:
tags: ["v*.*.**"]
workflow_dispatch:
inputs:
tag:
description: "Target tag to release"
required: true
type: string

env:
PGO_FILE: "default.pgo"

jobs:
release:
runs-on: ubuntu-latest
container:
image: ghcr.io/goreleaser/goreleaser-cross:latest
steps:
- uses: actions/checkout@master
with:
ref: "${{ inputs.tag || github.ref_name }}"

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache-dependency-path: '**/go.sum'

- uses: actions/download-artifact@v4
id: artifact
with:
name: pgo
continue-on-error: true

- name: Build PGO file
run: '[ -f "${{ env.PGO_FILE }}" ] || make pgo'

- run: git config --global --add safe.directory "$(pwd)"

- run: goreleaser release --clean
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
18 changes: 9 additions & 9 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ changelog:

dockers:
- image_templates:
- "ghcr.io/kitabisa/{{ .ProjectName }}:{{ .Tag }}"
- "ghcr.io/kitabisa/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}"
- "ghcr.io/kitabisa/{{ .ProjectName }}:v{{ .Major }}"
- "ghcr.io/kitabisa/{{ .ProjectName }}:latest"
dockerfile: Dockerfile
use: docker
build_flag_templates:
- "--pull"
- "--build-arg=VERSION={{ .Tag }}"
- "ghcr.io/kitabisa/{{ .ProjectName }}:{{ .Tag }}"
- "ghcr.io/kitabisa/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}"
- "ghcr.io/kitabisa/{{ .ProjectName }}:v{{ .Major }}"
- "ghcr.io/kitabisa/{{ .ProjectName }}:latest"
dockerfile: Dockerfile
use: docker
build_flag_templates:
- "--pull"
- "--build-arg=VERSION={{ .Tag }}"

0 comments on commit ded3754

Please sign in to comment.