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]>
  • Loading branch information
dwisiswant0 committed Mar 22, 2024
1 parent 2d11879 commit 0ab40ce
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 63 deletions.
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

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

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

- run: goreleaser release --clean
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

0 comments on commit 0ab40ce

Please sign in to comment.