Skip to content

Commit

Permalink
Update github workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Weifeng Wang <[email protected]>
  • Loading branch information
qclaogui committed Mar 28, 2024
1 parent 9a6c61c commit 1585a39
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 76 deletions.
3 changes: 2 additions & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name-template: 'v$NEXT_MINOR_VERSION'
tag-template: 'v$NEXT_MINOR_VERSION'
version-template: '$COMPLETE'
prerelease-identifier: rc
categories:
- title: '💥 Breaking Changes'
collapse-after: 15
Expand Down Expand Up @@ -34,7 +36,6 @@ categories:

change-template: '- $TITLE (#$NUMBER)'
change-title-escapes: '\<*_&#@`' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-template: '$COMPLETE'
no-changes-template: 'This release contains minor changes and bugfixes.'
template: |
Expand Down
28 changes: 8 additions & 20 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: GoReleaser Release
name: GoReleaser Publish Release

on:
workflow_call:
inputs:
isReleaseCandidate:
isPreRelease:
required: true
type: boolean
secrets:
Expand All @@ -14,38 +14,26 @@ env:
GORELEASER_VERSION: '1.24.0'

jobs:

publish-release:
name: ${{ inputs.isReleaseCandidate && 'prerelease' || 'release' }}
publish_release:
name: ${{ inputs.isPreRelease && 'prerelease' || 'release' }} publishing
runs-on: ubuntu-latest
steps:
- name: Free up disk space
run: |
echo "Available storage:"
df -h && echo
sudo docker image prune --all --force
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
echo "Available storage:"
df -h
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Install GoReleaser
run: |
wget -q https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/goreleaser_Linux_x86_64.tar.gz
tar -xzf goreleaser_Linux_x86_64.tar.gz
mv goreleaser /home/runner/go/bin/goreleaser-v${GORELEASER_VERSION}
- name: GoReleaser Release
if: ${{ !inputs.isReleaseCandidate }}
- if: ${{ !inputs.isPreRelease }}
run: ./tools/scripts/do-release.sh
env:
GITHUB_TOKEN: ${{ secrets.ghPAT }}
run: ./tools/scripts/do-release.sh

- name: GoReleaser Release Candidate
if: ${{ inputs.isReleaseCandidate }}
- if: ${{ inputs.isPreRelease }}
run: ./tools/scripts/do-release-candidate.sh
env:
GITHUB_TOKEN: ${{ secrets.ghPAT }}
run: ./tools/scripts/do-release-candidate.sh
25 changes: 11 additions & 14 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,45 @@
name: Release Drafter

# this workflow will run when someone labeled a pull request that targets branch is main
on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
workflow_dispatch: {}

jobs:
update_release_draft:
name: Trigger a draft release update
permissions:
# write permission is required to create a github release
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v6
id: draft
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.QCBOT_TOKEN }}
with:
commitish: main
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- name: Copy release notes from Draft
run: |
tag_name=${{ steps.draft.outputs.tag_name }}
echo "${{ steps.draft.outputs.body }}" > docs/release_notes/${tag_name:1}.md
- name: Upsert pull request
- name: Upsert Pull Request
uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e #v6.0.2
with:
token: ${{ secrets.QCBOT_TOKEN }}
title: Add release notes for ${{ steps.draft.outputs.tag_name }}
commit-message: |
Add release notes for ${{ steps.draft.outputs.tag_name }}
Signed-off-by: 🤖GitHub Actions[Bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: 🤖GitHub Actions[Bot] <41898282+github-actions[bot]@users.noreply.github.com>
commit-message: Add release notes for ${{ steps.draft.outputs.tag_name }}
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
signoff: true
# author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
assignees: qclaogui
# reviewers: qclaogui
body: |
🤖 Copy release notes from Draft
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Release start publishing
name: Release

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'

jobs:
check-release-tag:
check_tag:
name: Parse the pushed tag version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
Expand All @@ -22,12 +23,13 @@ jobs:
;;
esac
outputs:
isRc: ${{ steps.vars.outputs.isRc }}
publish:
name: start publishing
isPreRelease: ${{ steps.vars.outputs.isRc }}

update_release:
name: Trigger a release update
uses: ./.github/workflows/publish-release.yml
needs: [check-release-tag]
needs: [check_tag]
with:
isReleaseCandidate: ${{ needs.check-release-tag.outputs.isRc == 'true' }}
isPreRelease: ${{ needs.check_tag.outputs.isPreRelease == 'true' }}
secrets:
ghPAT: ${{ secrets.QCBOT_TOKEN }}
25 changes: 0 additions & 25 deletions .github/workflows/trigger-release-candidate.yml

This file was deleted.

23 changes: 16 additions & 7 deletions .github/workflows/trigger-release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
name: Trigger Release
name: Trigger Release (Manually)

# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputs
on:
workflow_dispatch: {}
workflow_dispatch:
inputs:
release:
description: 'Push tag and open PR to default branch'
required: true
default: 'prepare-release-candidate'
type: choice
options:
- prepare-release
- prepare-release-candidate

jobs:
rc:
name: Push release tag
prepare_release:
name: Trigger a ${{ inputs.release }} job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
Expand All @@ -16,10 +26,9 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Setup identity
uses: ./.github/actions/setup-identity
with:
token: ${{ secrets.QCBOT_TOKEN }}
- name: Push tag and open PR to default branch
run: make prepare-release

- run: make ${{ inputs.release }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

A simple command to run Grafana LGTMP Stack in Docker or Kubernetes.

## Quick Start
## Usage

Open a new terminal to create `compose.yaml`, an simple use case `compose.yaml` like so:
An simple use case `compose.yaml` like so:

```yaml
include: # include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later.
Expand Down

0 comments on commit 1585a39

Please sign in to comment.