-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
151 additions
and
188 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @khulnasoft/products-gdi-addons-adminrepo |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "develop" | ||
tags: | ||
- "v*" | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "develop" | ||
|
||
permissions: | ||
contents: write | ||
statuses: write | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- name: Install actionlint | ||
run: | | ||
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/v1.6.27/scripts/download-actionlint.bash) | ||
- uses: pre-commit/[email protected] | ||
|
||
release: | ||
needs: pre-commit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: false | ||
persist-credentials: false | ||
- name: Semantic release | ||
uses: ./ | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }} | ||
with: | ||
git_committer_name: ${{ secrets.SA_GH_USER_NAME }} | ||
git_committer_email: ${{ secrets.SA_GH_USER_EMAIL }} | ||
gpg_private_key: ${{ secrets.SA_GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.SA_GPG_PASSPHRASE }} | ||
extra_plugins: | | ||
@google/semantic-release-replace-plugin | ||
update-semver: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
needs: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: khulnasoft/addonfactory-update-semver@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }} | ||
with: | ||
git_committer_name: ${{ secrets.SA_GH_USER_NAME }} | ||
git_committer_email: ${{ secrets.SA_GH_USER_EMAIL }} | ||
gpg_private_key: ${{ secrets.SA_GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.SA_GPG_PASSPHRASE }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ repos: | |
language: script | ||
types: ["yaml"] | ||
files: ^.github/workflows/ | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,48 @@ | ||
# semantic-release-action | ||
Repository for providing basic semantic-release library functionalities as a GitHub action. | ||
Repository for providing basic semantic-release library functionalities as a GitHub Action. | ||
|
||
## Inputs | ||
| Input Parameter | Required | Description | | ||
|:----------------:|:--------:|----------------------------------------------------------------------------| | ||
| dry_run | false | dry run - if only version should be returned without releasing new version | | ||
| extra_plugins | false | extra plugins - if additional plugins are to be installed | | ||
| Input Parameter | Required | Description | | ||
|:-----------------:|:--------:|----------------------------------------------------------------------------| | ||
| dry_run | false | dry run - if only version should be returned without releasing new version | | ||
| extra_plugins | false | extra plugins - if additional plugins are to be installed | | ||
|git_committer_name | false | git commiter name - name of commiter used to sign bot commits | | ||
|git_committer_email| false | git commiter email - email address of committer used to sign bot commits | | ||
| gpg_private_key | false | gpg private key - key associated with committer | | ||
| passphrase | false | passphrase - passphrase for gpg private key | | ||
|
||
|
||
|
||
## Outputs | ||
| Input Parameter | Description | | ||
| Output Parameter | Description | | ||
|:---------------------------:|:---------------------------------------------------------------| | ||
| new_release_version | Version of the new release | | ||
| new_release_published | Whether a new release was published | | ||
|
||
## Example usage: | ||
|
||
```yaml | ||
# jobs section in GH actions workflow file | ||
# jobs section in GitHub Actions workflow file | ||
jobs: | ||
release: | ||
name: Release new version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: false | ||
persist-credentials: false | ||
- name: Semantic release | ||
id: semantic | ||
uses: khulnasoft/[email protected] | ||
uses: khulnasoft/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }} | ||
with: | ||
git_committer_name: ${{ secrets.SA_GH_USER_NAME }} | ||
git_committer_email: ${{ secrets.SA_GH_USER_EMAIL }} | ||
gpg_private_key: ${{ secrets.SA_GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.SA_GPG_PASSPHRASE }} | ||
extra_plugins: | | ||
@google/semantic-release-replace-plugin | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,78 @@ | ||
# ######################################################################## | ||
# Copyright 2023 KhulnaSoft, Ltd. | ||
# | ||
# 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: "Semantic release" | ||
description: "This tool performs semantic release or returns value of next release version" | ||
|
||
inputs: | ||
dry_run: | ||
description: "dry run - if only version should be returned without releasing new version" | ||
default: false | ||
default: "false" | ||
required: false | ||
extra_plugins: | ||
description: "plugins beside semantic-release/changelog, semantic-release/git, semantic-release/exec are to be installed" | ||
git_committer_name: | ||
description: "committer name for semantic release changes" | ||
required: false | ||
default: "semantic-release-bot" | ||
git_committer_email: | ||
description: "committer email address for semantic release changes" | ||
required: false | ||
default: "semantic-release-bot" | ||
gpg_private_key: | ||
description: "gpg private key matching committer email" | ||
required: false | ||
passphrase: | ||
description: "passphrase for gpg private key" | ||
required: false | ||
|
||
outputs: | ||
new_release_version: | ||
description: "Version of the new release" | ||
value: ${{ steps.semantic.outputs.version }} | ||
new_release_published: | ||
description: "Whether a new release was published" | ||
value: ${{ steps.semantic.outputs.new_release_published }} | ||
|
||
runs: | ||
using: "docker" | ||
image: "docker://ghcr.io/khulnasoft/semantic-release-action/semantic-release-action:v1.2.9" | ||
args: | ||
- ${{ inputs.dry_run }} | ||
- ${{ inputs.extra_plugins }} | ||
using: "composite" | ||
steps: | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
- name: Set up GPG | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
if: ${{ (inputs.dry_run == 'false') && (inputs.gpg_private_key != '') && (inputs.passphrase != '') }} | ||
with: | ||
gpg_private_key: ${{ inputs.gpg_private_key }} | ||
passphrase: ${{ inputs.passphrase }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
- name: Prepare Semantic Release | ||
run: | | ||
install_command="npm install --no-package-lock --legacy-peer-deps --save false -D @semantic-release/changelog @semantic-release/git @semantic-release/exec" | ||
if [[ ! -z "${{ inputs.extra_plugins }}" ]] | ||
then | ||
while IFS= read -r line | ||
do | ||
if [ ! -z "$line" ];then | ||
install_command="$install_command $(echo -e "$line" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" | ||
fi | ||
done <<< "${{ inputs.extra_plugins }}" | ||
fi | ||
$install_command | ||
shell: bash | ||
- id: semantic | ||
run: | | ||
if [[ ${{ inputs.dry_run }} == true ]] | ||
then | ||
echo "Running dry-run Semantic Release" | ||
npx semantic-release@23 --dry-run | ||
else | ||
echo "Running Semantic Release" | ||
npx semantic-release@23 | ||
fi | ||
shell: bash | ||
env: | ||
GIT_AUTHOR_NAME: ${{ inputs.git_committer_name }} | ||
GIT_AUTHOR_EMAIL: ${{ inputs.git_committer_email }} | ||
GIT_COMMITTER_NAME: ${{ inputs.git_committer_name }} | ||
GIT_COMMITTER_EMAIL: ${{ inputs.git_committer_email }} |
This file was deleted.
Oops, something went wrong.