Skip to content

Updated th2-grpc-common:test-grpc-common-go #3

Updated th2-grpc-common:test-grpc-common-go

Updated th2-grpc-common:test-grpc-common-go #3

Workflow file for this run

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.PUSH_PAT }}
- 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: Generate branch name
# run: echo "NEW_BRANCH=new-version-${{ env.TAG }}" >> $GITHUB_ENV
- 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: Create PR for version update
# env:
# GH_TOKEN: ${{ secrets.PUSH_PAT }}
# run: >
# gh pr create --title "Prepare next version"
# --body "Automated version update"
# --head ${{ env.NEW_BRANCH }}
# --base master
# --reviewer OptimumCode
# --reviewer Nikita-Smirnov-Exactpro
# --label ignore
# create-release:
# runs-on: ubuntu-latest
# needs:
# - generate-grpc
# permissions:
# contents: write
# steps:
# - name: 'Checkout Repository'
# uses: actions/checkout@v4
# - name: Store SHA of HEAD commit on ENV
# run: echo "GIT_HEAD=$(git rev-parse HEAD)" >> $GITHUB_ENV
# - name: Create tag
# id: create_tag
# uses: actions/github-script@v7
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# script: |
# const {GIT_HEAD} = process.env
# github.rest.git.createRef({
# owner: context.repo.owner,
# repo: context.repo.repo,
# ref: "refs/tags/${{ inputs.version }}",
# sha: `${GIT_HEAD}`
# })
# - name: Build changelog
# id: build_changelog
# uses: mikepenz/release-changelog-builder-action@v5
# with:
# configuration: changelog_config.json
# toTag: ${{ inputs.version }}
# 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 ${{ inputs.version }}
# tag: ${{ inputs.version }}
# token: ${{ secrets.GITHUB_TOKEN }}