-
Notifications
You must be signed in to change notification settings - Fork 16
feat: semantic release #2000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
PavelSBorisov
wants to merge
23
commits into
main
Choose a base branch
from
resd-455
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat: semantic release #2000
Changes from 6 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
f12b1fd
feat: semantic release
PavelSBorisov 4c1b8af
Merge branch 'main' into resd-455
PavelSBorisov b55cb30
chore: add missing steps and semantic release plugins
PavelSBorisov 067cc05
chore: fix typo
PavelSBorisov a41c707
feat: pr formatting workflow and renaming
PavelSBorisov dc1128a
chore: fix quotes
PavelSBorisov 1ec38b4
chore: small fixes
PavelSBorisov 88087b9
fix: fix docker in macos runner
PavelSBorisov ac9f6c4
fix: move to using helm registry login instead
PavelSBorisov a6c9373
fix: fix github token var
PavelSBorisov fc28252
fix: fix commit signoff
PavelSBorisov 28b9901
fix: modify workflow permissions
PavelSBorisov bfa14d7
fix: fix package name
PavelSBorisov cbe50e3
fix: fix helm chart name again
PavelSBorisov 7259f0e
fix: more helm package name fixes
PavelSBorisov ebc261a
chore: apply suggestion
PavelSBorisov f6e2563
Merge branch 'main' into resd-455
PavelSBorisov 95ef5ef
Merge branch 'main' into resd-455
PavelSBorisov 05d1008
chore(deps): bump checkout action to latest
PavelSBorisov 90bf569
chore: let release commit trigger ci so docker push workflow triggers
PavelSBorisov fc6274a
Merge branch 'main' into resd-455
jbair06 ea26dc9
fix: rework release workflow to publish in the correct order
PavelSBorisov 58d32a4
chore: add newline
PavelSBorisov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,105 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| name: "000: [USER] Official Release" | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry-run-enabled: | ||
| description: "Perform Dry Run" | ||
| type: boolean | ||
| required: false | ||
| default: false | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| REGISTRY: ghcr.io | ||
|
|
||
|
|
||
| jobs: | ||
| publish: | ||
| name: Publish Official Release of Hedera Transaction Tool | ||
| # MacOS runner for future compatibility (when frontend builds get added to semantic release) | ||
| runs-on: macos-latest | ||
|
|
||
PavelSBorisov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout Code | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| token: ${{ secrets.GH_ACCESS_TOKEN }} | ||
|
|
||
| - name: Install GnuPG Tools | ||
| run: brew install gnupg | ||
|
|
||
| - name: Import GPG Key | ||
| id: gpg | ||
| uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0 | ||
PavelSBorisov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| with: | ||
| git_commit_gpgsign: true | ||
| git_user_signingkey: true | ||
| git_tag_gpgsign: false | ||
| git_config_global: true | ||
| gpg_private_key: ${{ secrets.GPG_KEY_CONTENTS }} | ||
| passphrase: ${{ secrets.GPG_KEY_PASSPHRASE }} | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | ||
| with: | ||
| node-version: 22 | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | ||
| with: | ||
| version: latest | ||
|
|
||
| - name: Setup Helm | ||
| uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1 | ||
| with: | ||
| version: "v3.12.3" | ||
|
|
||
| - name: Log in to the Container registry | ||
| uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # 3.5.0 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Install Semantic Release | ||
| if: ${{ github.event_name == 'workflow_dispatch' && !cancelled() && !failure() }} | ||
| run: | | ||
| npm install -g semantic-release@24.2.0 @semantic-release/git@10.0.1 @semantic-release/github@11.0.1 \ | ||
| @semantic-release/exec@6.0.3 semantic-release-helm3@2.9.3 \ | ||
| conventional-changelog-conventionalcommits@8.0.0 \ | ||
| @commitlint/cli@19.5.0 @commitlint/config-conventional@19.5.0 \ | ||
| marked-mangle@1.1.10 marked-gfm-heading-id@4.1.1 semantic-release-conventional-commits@3.0.0 | ||
|
|
||
| # Both actual and dry-run semantic-release will output the new version | ||
| # in the logs but actual release should also publish a tag&release on GitHub | ||
| # The helm charts are published to the GitHub artifact registry | ||
| # as part of the release process (configured in .releaserc) | ||
| - name: Run Semantic Release | ||
| if: ${{ !cancelled() && !failure() }} | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | ||
| GIT_AUTHOR_NAME: ${{ steps.gpg.outputs.name}} | ||
| GIT_AUTHOR_EMAIL: ${{ steps.gpg.outputs.email}} | ||
| GIT_COMMITTER_NAME: ${{ steps.gpg.outputs.name}} | ||
| GIT_COMMITTER_EMAIL: ${{ steps.gpg.outputs.email}} | ||
| run: | | ||
| if [[ "${{ inputs.dry-run-enabled }}" == "true" ]]; then | ||
| echo "Dry Running semantic-release now..." | ||
| npx semantic-release --dry-run | ||
| else | ||
| echo "Running semantic-release now..." | ||
| npx semantic-release --debug | ||
| fi | ||
This file contains hidden or 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,57 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| name: "001: [FLOW] PR Formatting" | ||
| on: | ||
| pull_request_target: | ||
| types: | ||
| - assigned | ||
| - unassigned | ||
| - labeled | ||
| - unlabeled | ||
| - opened | ||
| - reopened | ||
| - edited | ||
| - converted_to_draft | ||
| - ready_for_review | ||
| - review_requested | ||
| - review_request_removed | ||
| - locked | ||
| - unlocked | ||
| - synchronize | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| permissions: | ||
| statuses: write | ||
|
|
||
| jobs: | ||
| title-check: | ||
| name: Title Check | ||
| runs-on: network-node-linux-medium | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Check PR Title | ||
| uses: step-security/action-semantic-pull-request@bc0cf74f5be4ce34accdec1ae908dff38dc5def1 # v6.1.1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | ||
|
|
||
| assignee-check: | ||
| name: Assignee Check | ||
| runs-on: network-node-linux-medium | ||
|
|
||
PavelSBorisov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Check Assignee | ||
| if: ${{ github.event.pull_request.assignees == null || github.event.pull_request.assignees[0] == null }} | ||
| run: | | ||
| echo "Assignee is not set. Failing the workflow." | ||
| exit 1 | ||
PavelSBorisov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
18 changes: 9 additions & 9 deletions
18
.github/workflows/publish-docker-images.yaml → ...hub/workflows/300-flow-docker-images.yaml
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
.github/workflows/test-backend.yaml → .github/workflows/301-flow-test-backend.yaml
This file contains hidden or 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,4 +1,4 @@ | ||
| name: Test Backend | ||
| name: "301: [FLOW] Test Backend" | ||
|
|
||
| on: | ||
| push: | ||
|
|
||
2 changes: 1 addition & 1 deletion
2
.github/workflows/test-frontend.yaml → ...hub/workflows/302-flow-test-frontend.yaml
This file contains hidden or 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,4 +1,4 @@ | ||
| name: Test Frontend | ||
| name: "302: [FLOW] Test Frontend" | ||
|
|
||
| on: | ||
| push: | ||
|
|
||
This file contains hidden or 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,104 @@ | ||
| { | ||
| "plugins": [ | ||
| [ | ||
| "@semantic-release/commit-analyzer", | ||
| { | ||
| "preset": "conventionalcommits" | ||
| } | ||
| ], | ||
| [ | ||
| "@semantic-release/release-notes-generator", | ||
| { | ||
| "preset": "conventionalcommits" | ||
| } | ||
| ], | ||
| [ | ||
| "semantic-release-helm3", | ||
| { | ||
| "chartPath": "./charts/transaction-tool" | ||
| } | ||
| ], | ||
| "@semantic-release/git", | ||
| "@semantic-release/github" | ||
| ], | ||
| "verifyRelease": [ | ||
| [ | ||
| "@semantic-release/exec", | ||
| { "cmd": "echo 'Release version: ${nextRelease.version}'" } | ||
| ] | ||
| ], | ||
| "prepare": [ | ||
| [ | ||
| "semantic-release-helm3", | ||
| { | ||
| "chartPath": "./charts/transaction-tool" | ||
| } | ||
| ], | ||
| [ | ||
| "@semantic-release/git", | ||
| { | ||
| "assets": [ | ||
| "charts/transaction-tool/Chart.yaml" | ||
| ], | ||
| "message": "chore(release): ${nextRelease.version} [skip ci]\n\nSigned-off-by: Hedera Automation <hedera-eng-automation@swirldslabs.com>" | ||
| } | ||
| ] | ||
| ], | ||
| "publish": [ | ||
| [ | ||
| "@semantic-release/exec", | ||
| { "cmd": "helm dependency update charts/transaction-tool" } | ||
| ], | ||
| [ | ||
| "@semantic-release/exec", | ||
| { "cmd": "helm package charts/transaction-tool" } | ||
| ], | ||
| [ | ||
| "@semantic-release/exec", | ||
| { "cmd": "helm push transaction-tool-${nextRelease.version}.tgz oci://ghcr.io/hashgraph/transaction-tool" } | ||
| ], | ||
| [ | ||
| "@semantic-release/github", | ||
| { | ||
| "assets": [ | ||
| { | ||
| "path": "transaction-tool-*.tgz" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| ], | ||
| "branches":[ | ||
| { | ||
| "name": "main" | ||
| }, | ||
| { | ||
| "name": "release/([0-9]+).([0-9]+)", | ||
| "channel": "${name.replace(/release\\//g, '').split('.')[0]}.${name.replace(/release\\//g, '').split('.')[1]}.x", | ||
| "range": "${name.replace(/release\\//g, '').split('.')[0]}.${name.replace(/release\\//g, '').split('.')[1]}.x" | ||
| }, | ||
| { | ||
| "name": "alpha/*", | ||
| "prerelease": "alpha", | ||
| "channel": "alpha" | ||
| }, | ||
| { | ||
| "name": "ci/*", | ||
| "prerelease": "alpha", | ||
| "channel": "alpha" | ||
| }, | ||
| { | ||
| "name": "beta/*", | ||
| "prerelease": "beta", | ||
| "channel": "beta" | ||
| }, | ||
| { | ||
| "name": "rc/*", | ||
| "prerelease": "rc", | ||
| "channel": "rc" | ||
| }, | ||
| { | ||
| "name": "resd-455" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to be removed before merging
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sure this is removed before merging 🥳 |
||
| } | ||
| ] | ||
| } | ||
PavelSBorisov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.