-
Notifications
You must be signed in to change notification settings - Fork 2
Add workflows #126
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
Merged
Merged
Add workflows #126
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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,38 @@ | ||
| name: Deploy Develop | ||
|
|
||
| env: | ||
| APP_LOCATION: '' | ||
| OUTPUT_LOCATION: 'packages/website/build' | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| deploy-dev: | ||
| runs-on: ubuntu-latest | ||
| name: Deploy to Dev Environment | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Deploy to Development | ||
| uses: Azure/static-web-apps-deploy@v1 | ||
| with: | ||
| azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_DEV_API_TOKEN }} | ||
| repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
| output_location: ${{ env.OUTPUT_LOCATION }} | ||
| app_location: ${{ env.APP_LOCATION }} | ||
| app_build_command: 'pnpm website build' | ||
| action: 'upload' | ||
| skip_api_build: true | ||
| deployment_environment: 'dev' | ||
| env: | ||
| CUSTOM_BUILD_COMMAND: corepack enable && corepack prepare pnpm@10.9.0 --activate && pnpm install --frozen-lockfile && pnpm ui build && pnpm website build | ||
| ENABLE_NODE_MONOREPO_BUILD: true | ||
| NODE_VERSION: 22 | ||
This file was deleted.
Oops, something went wrong.
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,80 @@ | ||
| name: Deploy Production | ||
|
|
||
| env: | ||
| APP_LOCATION: '' | ||
| OUTPUT_LOCATION: 'packages/website/build' | ||
|
|
||
| on: | ||
| push: | ||
| branches: ['release/*'] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| deploy-production: | ||
| runs-on: ubuntu-latest | ||
| name: Deploy to Production | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Enable Corepack | ||
| run: corepack enable | ||
|
|
||
| - name: Install pnpm | ||
| run: corepack prepare pnpm@10.9.0 --activate | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Build UI Package | ||
| run: pnpm ui build | ||
|
|
||
| - name: Build Documentation | ||
| run: pnpm website build | ||
|
|
||
| - name: Check if version changed | ||
| id: version-check | ||
| run: | | ||
| CURRENT_VERSION=$(node -p "require('./package.json').version") | ||
| PUBLISHED_VERSION=$(npm view @axiomhq/axiom-ui-components version 2>/dev/null || echo "0.0.0") | ||
|
||
| echo "current-version=$CURRENT_VERSION" >> $GITHUB_OUTPUT | ||
| echo "published-version=$PUBLISHED_VERSION" >> $GITHUB_OUTPUT | ||
| if [ "$CURRENT_VERSION" != "$PUBLISHED_VERSION" ]; then | ||
| echo "version-changed=true" >> $GITHUB_OUTPUT | ||
| echo "Version changed from $PUBLISHED_VERSION to $CURRENT_VERSION" | ||
| else | ||
| echo "version-changed=false" >> $GITHUB_OUTPUT | ||
| echo "Version unchanged: $CURRENT_VERSION" | ||
| fi | ||
|
|
||
| - name: Publish NPM Package | ||
| if: steps.version-check.outputs.version-changed == 'true' | ||
| run: pnpm publish --access public | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
|
||
| - name: Deploy Documentation to Production | ||
| uses: Azure/static-web-apps-deploy@v1 | ||
| with: | ||
| azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_PROD_API_TOKEN }} | ||
| repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
| output_location: ${{ env.OUTPUT_LOCATION }} | ||
| app_location: ${{ env.APP_LOCATION }} | ||
| app_build_command: 'pnpm website build' | ||
| action: 'upload' | ||
| skip_api_build: true | ||
| deployment_environment: 'release' | ||
| env: | ||
| CUSTOM_BUILD_COMMAND: corepack enable && corepack prepare pnpm@10.9.0 --activate && pnpm install --frozen-lockfile && pnpm ui build && pnpm website build | ||
| ENABLE_NODE_MONOREPO_BUILD: true | ||
| NODE_VERSION: 22 | ||
This file was deleted.
Oops, something went wrong.
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,51 @@ | ||
| name: Validate PR | ||
|
|
||
| env: | ||
| APP_LOCATION: '' | ||
| OUTPUT_LOCATION: 'packages/website/build' | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main, 'release/*'] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| validate: | ||
| runs-on: ubuntu-latest | ||
| name: Validate PR | ||
| env: | ||
| ENABLE_NODE_MONOREPO_BUILD: true | ||
| NODE_VERSION: 22 | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
|
|
||
| - name: Enable Corepack | ||
| run: corepack enable | ||
|
|
||
| - name: Install pnpm | ||
| run: corepack prepare pnpm@10.9.0 --activate | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Build UI Package | ||
| run: pnpm ui build | ||
|
|
||
| - name: Build Documentation | ||
| run: pnpm website build | ||
|
|
||
| - name: Run Quality Checks | ||
| run: | | ||
| pnpm lint:fix | ||
| pnpm format | ||
| pnpm typecheck | ||
| pnpm file-lint |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, could you change the
corepack enable && corepack prepare pnpm@10.9.0 --activateto
npm i -g corepack@latest && corepack preparehere and in other occurences?It'd bulletproof the solution for upcoming versions of node that won't bundle corepack and on top of that it'd install pnpm with proper version taken from
packageManagerfield inpackage.json.