Removed version step #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: generate grpc using new th2-grpc-common | |
# on: | |
# workflow_dispatch: | |
# inputs: | |
# common-tag: | |
# type: string | |
# description: "tag name of th2-grpc-common repository" | |
on: | |
push: | |
branches: | |
- generate-grpc-test | |
env: | |
MAKEFILE: Makefile | |
VERSION_VARIABLE: TH2_GRPC_COMMON_VERSION | |
TAG: test-grpc-common-go | |
jobs: | |
generate-grpc: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: 'Checkout repository' | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get nearest tag | |
run: echo "NEAREST_TAG=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Install protoc | |
run: make install-protoc | |
- name: Check gRPC generated files not manually changed | |
shell: bash | |
run: make generate-grpc-files | |
- name: Update th2-grpc-common tag in Makefile | |
shell: bash | |
run: > | |
sed --in-place "s/^${{ env.VERSION_VARIABLE }}=.*/${{ env.VERSION_VARIABLE }}=${{ env.TAG }} #/" "${{ env.MAKEFILE }}" | |
# -- the next part should be reused from another workflow | |
- name: Install protoc | |
run: make install-protoc | |
- name: Check gRPC generated files not manually changed | |
shell: bash | |
run: make check-grpc-files | |
- name: Check sources | |
run: make run-test | |
- name: Build sources | |
run: make build | |
# -- | |
- name: Commit next dev version | |
id: commit_next_state | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: "['*.go', '${{ env.MAKEFILE }}']" | |
default_author: github_actions | |
message: "Updated th2-grpc-common:${{ env.TAG }}" | |
tag: ${{ env.TAG }} | |
- name: Build changelog | |
id: build_changelog | |
uses: mikepenz/release-changelog-builder-action@v5 | |
with: | |
configuration: changelog_config.json | |
toTag: ${{ env.NEAREST_TAG }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create release | |
id: create_release | |
uses: ncipollo/[email protected] | |
with: | |
body: ${{ steps.build_changelog.outputs.changelog }} | |
name: Release ${{ env.TAG }} | |
tag: ${{ env.TAG }} | |
token: ${{ secrets.GITHUB_TOKEN }} |