-
Notifications
You must be signed in to change notification settings - Fork 10
chore: refactor workflows #274
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
Changes from all commits
Commits
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,125 @@ | ||
| # yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json | ||
| --- | ||
| name: Publish | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: ["Integration Tests"] | ||
| types: | ||
| - completed | ||
| branches: | ||
| - main | ||
| push: | ||
| tags: | ||
| - 'v*.*.*' | ||
| - '*.*.*' | ||
|
|
||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| publish-ea: | ||
| if: | | ||
| github.event_name == 'workflow_run' && | ||
| github.event.workflow_run.head_branch == 'main' | ||
| runs-on: ubuntu-latest | ||
| name: Publish EA release to NPM | ||
| steps: | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.workflow_run.head_sha }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install node 24 | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: 24 | ||
| cache: npm | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Update npm | ||
| run: npm install -g npm@latest | ||
|
|
||
| - name: Configure git | ||
| run: | | ||
| git config user.name "${{ github.actor }}" | ||
| git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
|
|
||
| - name: Get current version | ||
| id: current-version | ||
| run: | | ||
| VERSION=$(node -p "require('./package.json').version") | ||
| # Remove both -ea. and -ea- formats for compatibility | ||
| BASE_VERSION=$(echo "$VERSION" | sed -E 's/-ea[.-][0-9]+$//') | ||
| echo "base-version=$BASE_VERSION" >> "$GITHUB_OUTPUT" | ||
| echo "current-version=$VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Update package with EA version | ||
| id: bump | ||
| run: | | ||
| EA_VERSION="${{ steps.current-version.outputs.base-version }}-ea-${{ github.run_number }}" | ||
| npm version "$EA_VERSION" --no-git-tag-version | ||
| echo "version=$EA_VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Install project modules | ||
| run: npm ci | ||
|
|
||
| - name: Compile project | ||
| run: npm run compile | ||
|
|
||
| - name: Publish package | ||
| run: npm publish --verbose --tag ea --access public --provenance | ||
|
|
||
| - name: Commit and push package modifications | ||
| run: | | ||
| git add package.json | ||
| git add package-lock.json | ||
| git commit -m "build: updated package with ${{ steps.bump.outputs.version }} [skip ci]" | ||
| git push | ||
|
|
||
| publish-release: | ||
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
| runs-on: ubuntu-latest | ||
| name: Publish release to NPM | ||
| steps: | ||
| - name: Checkout sources | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.ref }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install node 24 | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: 24 | ||
| cache: npm | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Update npm | ||
| run: npm install -g npm@latest | ||
|
|
||
| - name: Get tag name | ||
| id: tag | ||
| run: | | ||
| TAG_NAME=${GITHUB_REF#refs/tags/} | ||
| echo "name=$TAG_NAME" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Update package.json with tag version | ||
| id: update-version | ||
| run: | | ||
| TAG_NAME="${{ steps.tag.outputs.name }}" | ||
| # Remove 'v' prefix if present | ||
| VERSION=${TAG_NAME#v} | ||
| npm version "$VERSION" --no-git-tag-version | ||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Install project modules | ||
| run: npm ci | ||
|
|
||
| - name: Compile project | ||
| run: npm run compile | ||
|
|
||
| - name: Publish package | ||
| run: npm publish --verbose --access public --provenance | ||
Oops, something went wrong.
Oops, something went wrong.
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.