-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
12 changed files
with
375 additions
and
119 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,45 @@ | ||
name: "[Release] connect bump versions" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
semver: | ||
type: choice | ||
description: semver | ||
options: | ||
- patch | ||
- minor | ||
- prerelease | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
bump-versions: | ||
if: github.repository == 'trezor/trezor-suite' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# Number of commits to fetch. 0 indicates all history for all branches and tags. | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ".nvmrc" | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Set git for trezor-ci | ||
run: | | ||
git config --global user.name "trezor-ci" | ||
git config --global user.email "${{ secrets.TREZOR_BOT_EMAIL }}" | ||
- name: Check dependencies to update | ||
run: | | ||
node ./ci/scripts/connect-bump-versions.js ${{ github.event.inputs.semver }} |
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,98 @@ | ||
name: "[Release] connect NPM and v9" | ||
|
||
permissions: | ||
id-token: write # for fetching the OIDC token | ||
contents: read # for actions/checkout | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
commit_sha: | ||
description: "The commit SHA to checkout" | ||
required: true | ||
type: string | ||
deploymentType: | ||
description: "Select the deployment type. (example: canary, stable)" | ||
required: true | ||
type: choice | ||
options: | ||
- canary | ||
- stable | ||
|
||
jobs: | ||
# Version should have been bumped by now thanks to ./ci/scripts/connect-release-init-npm.js | ||
extract-version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.set-version.outputs.version }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# Number of commits to fetch. 0 indicates all history for all branches and tags. | ||
fetch-depth: 0 | ||
# Checkout the specified commit | ||
ref: ${{ github.event.inputs.commit_sha }} | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ".nvmrc" | ||
|
||
- name: Extract connect version | ||
id: set-version | ||
run: echo "version=$(node ./ci/scripts/get-connect-version.js)" >> $GITHUB_OUTPUT | ||
|
||
create-push-release-branch: | ||
needs: [extract-version] | ||
name: "Create release branch for version ${{ needs.extract-version.outputs.version }}" | ||
runs-on: ubuntu-latest | ||
outputs: | ||
branch_name: ${{ steps.push-branch.outputs.branch_name }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.TREZOR_BOT_TOKEN }} | ||
fetch-depth: 0 | ||
# Checkout the specified commit | ||
ref: ${{ github.event.inputs.commit_sha }} | ||
|
||
- name: Setup Git config | ||
run: | | ||
git config --global user.name "trezor-ci" | ||
git config --global user.email "${{ secrets.TREZOR_BOT_EMAIL }}" | ||
- name: Create and push new branch | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TREZOR_BOT_TOKEN }} | ||
BRANCH_NAME: "release/connect/${{ needs.extract-version.outputs.version }}" | ||
run: | | ||
echo ${{ env.BRANCH_NAME }} | ||
git checkout -b ${{ env.BRANCH_NAME }} | ||
git push origin ${{ env.BRANCH_NAME }} | ||
echo "branch_name=${{ env.BRANCH_NAME }}" >> $GITHUB_OUTPUT | ||
trigger-v9-staging-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: gh workflow run .github/workflows/release-connect-v9-staging.yml --ref $BRANCH_NAME | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH_NAME: ${{ needs.create-push-release-branch.outputs.branch_name }} | ||
|
||
trigger-v9-production-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: gh workflow run .github/workflows/release-connect-v9-production.yml --ref $BRANCH_NAME | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH_NAME: ${{ needs.create-push-release-branch.outputs.branch_name }} | ||
|
||
trigger-npm-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: gh workflow run .github/workflows/release-connect-npm-init.yml --ref $BRANCH_NAME --field deploymentType=${{ github.event.inputs.deploymentType }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH_NAME: ${{ needs.create-push-release-branch.outputs.branch_name }} |
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
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
37 changes: 37 additions & 0 deletions
37
.github/workflows/template-check-connect-version-match.yml
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,37 @@ | ||
name: Check connect version match with branch | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
branch_ref: | ||
description: "The full ref of the branch" | ||
required: true | ||
type: string | ||
extracted_version: | ||
description: "The version extracted from the package.json or other source" | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
check-version-match: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Extract branch version | ||
id: extract-branch-version | ||
run: | | ||
BRANCH_REF="${{ inputs.branch_ref }}" | ||
BRANCH_VERSION="${BRANCH_REF#refs/heads/release/connect/}" | ||
echo "branch_version=$BRANCH_VERSION" >> $GITHUB_OUTPUT | ||
- name: Check if version in package.json matches the one in branch name | ||
run: | | ||
BRANCH_VERSION="${{ steps.extract-branch-version.outputs.branch_version }}" | ||
EXTRACTED_VERSION="${{ inputs.extracted_version }}" | ||
echo "Branch Version: $BRANCH_VERSION" | ||
echo "Extracted Version: $EXTRACTED_VERSION" | ||
if [[ "$BRANCH_VERSION" != "$EXTRACTED_VERSION" ]]; then | ||
echo "The extracted version ($EXTRACTED_VERSION) does not match the version in the branch name ($BRANCH_VERSION)" | ||
exit 1 # Fail the job if versions don't match | ||
else | ||
echo "Version check passed: $BRANCH_VERSION matches $EXTRACTED_VERSION" | ||
fi |
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
Oops, something went wrong.