-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from mangata-finance/chore/fix-automation-types
chore: update ci automation
- Loading branch information
Showing
1 changed file
with
19 additions
and
24 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 |
---|---|---|
|
@@ -8,16 +8,11 @@ on: | |
type: string | ||
required: true | ||
default: "mangatasolutions/mangata-node:develop" | ||
branchPreRelease: | ||
branch: | ||
description: "Branch for pre-release" | ||
type: string | ||
required: true | ||
default: "" | ||
branchMangataNode: | ||
description: "Branch for mangata-node" | ||
type: string | ||
required: true | ||
default: "develop" | ||
|
||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
@@ -49,7 +44,7 @@ jobs: | |
- name: NPM version bump type definitions | ||
working-directory: packages/type-definitions | ||
env: | ||
INPUTS_BRANCH: ${{ github.event.inputs.branchPreRelease }} | ||
INPUTS_BRANCH: ${{ github.event.inputs.branch }} | ||
run: | | ||
# Branch name sanitization added to avoid issues with npm version command | ||
# Example `ci/new-branch-1.0.0` -> `ci-new-branch-1-0-0` | ||
|
@@ -61,8 +56,8 @@ jobs: | |
git config user.email [email protected] | ||
git add . | ||
git commit -m "chore: updated type definitions to new prerelease version" | ||
git pull origin ${{ github.event.inputs.branchPreRelease }} --rebase | ||
git push origin ${{ github.event.inputs.branchPreRelease }} | ||
git pull origin ${{ github.event.inputs.branch }} --rebase | ||
git push origin ${{ github.event.inputs.branch }} | ||
- name: Build type definitions | ||
run: npx nx run @mangata-finance/type-definitions:build | ||
|
@@ -71,7 +66,7 @@ jobs: | |
working-directory: dist/packages/type-definitions | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
INPUTS_BRANCH: ${{ github.event.inputs.branchPreRelease }} | ||
INPUTS_BRANCH: ${{ github.event.inputs.branch }} | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc | ||
|
@@ -92,7 +87,7 @@ jobs: | |
with: | ||
repository: mangata-finance/mangata-node | ||
path: mangata-repo | ||
ref: ${{ github.event.inputs.branchMangataNode }} | ||
ref: ${{ github.event.inputs.branch }} | ||
|
||
- name: Setup Node version and cache dependencies | ||
uses: actions/setup-node@v3 | ||
|
@@ -146,7 +141,7 @@ jobs: | |
- name: NPM version bump | ||
working-directory: packages/types | ||
env: | ||
INPUTS_BRANCH: ${{ github.event.inputs.branchPreRelease }} | ||
INPUTS_BRANCH: ${{ github.event.inputs.branch }} | ||
run: | | ||
# Branch name sanitization added to avoid issues with npm version command | ||
# Example `ci/new-branch-1.0.0` -> `ci-new-branch-1-0-0` | ||
|
@@ -164,8 +159,8 @@ jobs: | |
git config user.email [email protected] | ||
git add . | ||
git commit -m "chore: updated types to new prerelease version" | ||
git pull origin ${{ github.event.inputs.branchPreRelease }} --rebase | ||
git push origin ${{ github.event.inputs.branchPreRelease }} | ||
git pull origin ${{ github.event.inputs.branch }} --rebase | ||
git push origin ${{ github.event.inputs.branch }} | ||
- name: Build types | ||
run: npx nx run @mangata-finance/types:build | ||
|
@@ -174,7 +169,7 @@ jobs: | |
working-directory: dist/packages/types | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
INPUTS_BRANCH: ${{ github.event.inputs.branchPreRelease }} | ||
INPUTS_BRANCH: ${{ github.event.inputs.branch }} | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc | ||
|
@@ -198,12 +193,12 @@ jobs: | |
|
||
- name: Type definitions version for branch | ||
run: | | ||
branchTypeDefinitionsVersion=$(npm show @mangata-finance/type-definitions dist-tags."$(echo "${{ github.event.inputs.branchPreRelease }}" | sed -E 's@[/\.]@-@g; s@_@-@g')") | ||
branchTypeDefinitionsVersion=$(npm show @mangata-finance/type-definitions dist-tags."$(echo "${{ github.event.inputs.branch }}" | sed -E 's@[/\.]@-@g; s@_@-@g')") | ||
echo "BRANCH_TYPE_DEFINITIONS_VERSION=$branchTypeDefinitionsVersion" >> $GITHUB_ENV | ||
- name: Types version for branch | ||
run: | | ||
branchTypesVersion=$(npm show @mangata-finance/types dist-tags."$(echo "${{ github.event.inputs.branchPreRelease }}" | sed -E 's@[/\.]@-@g; s@_@-@g')") | ||
branchTypesVersion=$(npm show @mangata-finance/types dist-tags."$(echo "${{ github.event.inputs.branch }}" | sed -E 's@[/\.]@-@g; s@_@-@g')") | ||
echo "BRANCH_TYPES_VERSION=$branchTypesVersion" >> $GITHUB_ENV | ||
- name: Update types dependency version | ||
|
@@ -227,7 +222,7 @@ jobs: | |
- name: NPM version bump | ||
working-directory: packages/sdk | ||
env: | ||
INPUTS_BRANCH: ${{ github.event.inputs.branchPreRelease }} | ||
INPUTS_BRANCH: ${{ github.event.inputs.branch }} | ||
run: | | ||
# Branch name sanitization added to avoid issues with npm version command | ||
# Example `ci/new-branch-1.0.0` -> `ci-new-branch-1-0-0` | ||
|
@@ -239,8 +234,8 @@ jobs: | |
git config user.email [email protected] | ||
git add . | ||
git commit -m "chore: updated sdk to new prerelease version" | ||
git pull origin ${{ github.event.inputs.branchPreRelease }} --rebase | ||
git push origin ${{ github.event.inputs.branchPreRelease }} | ||
git pull origin ${{ github.event.inputs.branch }} --rebase | ||
git push origin ${{ github.event.inputs.branch }} | ||
- name: Build sdk | ||
run: npx nx run @mangata-finance/sdk:build | ||
|
@@ -249,7 +244,7 @@ jobs: | |
working-directory: dist/packages/sdk | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
INPUTS_BRANCH: ${{ github.event.inputs.branchPreRelease }} | ||
INPUTS_BRANCH: ${{ github.event.inputs.branch }} | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc | ||
|
@@ -260,10 +255,10 @@ jobs: | |
- name: Show released versions | ||
run: | | ||
echo "Version of @mangata-finance/type-definitions:" | ||
npm show @mangata-finance/type-definitions dist-tags."$(echo "${{ github.event.inputs.branchPreRelease }}" | sed -E 's@[/\.]@-@g; s@_@-@g')" | ||
npm show @mangata-finance/type-definitions dist-tags."$(echo "${{ github.event.inputs.branch }}" | sed -E 's@[/\.]@-@g; s@_@-@g')" | ||
echo "Version of @mangata-finance/types:" | ||
npm show @mangata-finance/types dist-tags."$(echo "${{ github.event.inputs.branchPreRelease }}" | sed -E 's@[/\.]@-@g; s@_@-@g')" | ||
npm show @mangata-finance/types dist-tags."$(echo "${{ github.event.inputs.branch }}" | sed -E 's@[/\.]@-@g; s@_@-@g')" | ||
echo "Version of @mangata-finance/sdk:" | ||
npm show @mangata-finance/sdk dist-tags."$(echo "${{ github.event.inputs.branchPreRelease }}" | sed -E 's@[/\.]@-@g; s@_@-@g')" | ||
npm show @mangata-finance/sdk dist-tags."$(echo "${{ github.event.inputs.branch }}" | sed -E 's@[/\.]@-@g; s@_@-@g')" |