Skip to content

Corrected Build changelog #2

Corrected Build changelog

Corrected Build changelog #2

Workflow file for this run

name: Update gRPC source
# 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:
update-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 }}"
- 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 changes and create tag
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: .github/workflows/update-grpc-changelog-config.json
fromTag: ${{ env.NEAREST_TAG }}
toTag: ${{ env.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 }}