-
Notifications
You must be signed in to change notification settings - Fork 138
Setup trusted publishing for npm packages, restructure workflows #720
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
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c04933c
feat: add GitHub Actions workflow for publishing npm and NuGet packages
alexslavr c513ead
chore: remove release-packages job from CI workflow
alexslavr 0157ba0
feat: enhance publish workflow with dry-run option and restructure jobs
alexslavr 82de3d7
chore: update Node.js version in publish workflow and remove redundan…
alexslavr ad5224a
fix: pin ubuntu version, use https
alexslavr 0f2f383
Potential fix for pull request finding
alexslavr 36d0852
fix: update CI build artifact links and descriptions in documentation
alexslavr e898322
fix: restore id-token permission for publish job in workflow
alexslavr f1e9a10
feat: restore old release-packages job behavior
alexslavr 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
Some comments aren't visible on the classic Files Changed page.
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 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,102 @@ | ||
| name: Publish | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry-run: | ||
| description: 'Dry run (skip actual publishing)' | ||
| type: boolean | ||
| default: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| NPM_CONFIG_AUDIT: "false" | ||
| NPM_CONFIG_FUND: "false" | ||
| DOTNET_CLI_TELEMETRY_OPTOUT: "true" | ||
| NUGET_XMLDOC_MODE: "skip" | ||
|
|
||
| jobs: | ||
|
|
||
| pack: | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| env: | ||
| RELEASE_KEY_SECRET: ${{ secrets.RELEASE_KEY_SECRET }} | ||
| DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 | ||
|
|
||
| steps: | ||
| - uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-quality: ga | ||
| dotnet-version: | | ||
| 3.1 | ||
|
alexslavr marked this conversation as resolved.
|
||
| 8.0 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '24' | ||
|
|
||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Decrypt signing key | ||
| if: ${{ env.RELEASE_KEY_SECRET != '' }} | ||
| run: | | ||
| wget https://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb | ||
| sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb | ||
| curl -L -o /opt/secure-file.zip https://github.com/appveyor/secure-file/releases/download/1.0.1/secure-file.zip | ||
| unzip /opt/secure-file.zip -d /opt/secure-file | ||
|
alexslavr marked this conversation as resolved.
|
||
| dotnet /opt/secure-file/secure-file.dll -decrypt net/DevExtreme.AspNet.Data/release.snk.enc -secret ${{ env.RELEASE_KEY_SECRET }} | ||
|
alexslavr marked this conversation as resolved.
|
||
|
|
||
| - name: Build no-jquery package | ||
| run: node build/make-nojquery | ||
|
|
||
| - name: Set package versions | ||
| run: node build/replace-meta "${{ github.run_number }}" "${{ github.ref }}" "${{ github.repository }}" | ||
|
alexslavr marked this conversation as resolved.
|
||
|
|
||
| - name: Pack npm packages | ||
| run: | | ||
| npm pack | ||
| npm pack ./js-nojquery | ||
|
|
||
| - name: Pack NuGet package | ||
| if: ${{ env.RELEASE_KEY_SECRET != '' }} | ||
| run: dotnet pack net/DevExtreme.AspNet.Data --configuration=Release --include-symbols | ||
|
|
||
| - name: Upload NuGet packages as artifacts | ||
| if: ${{ env.RELEASE_KEY_SECRET != '' }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: nuget-packages | ||
| path: net/DevExtreme.AspNet.Data/bin/Release/*.nupkg | ||
|
alexslavr marked this conversation as resolved.
alexslavr marked this conversation as resolved.
alexslavr marked this conversation as resolved.
|
||
|
|
||
| - name: Upload npm packages as artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: npm-packages | ||
| path: devextreme-aspnet-data-*.tgz | ||
|
|
||
| publish: | ||
| runs-on: ubuntu-latest | ||
| needs: pack | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| environment: npmjs | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
|
alexslavr marked this conversation as resolved.
|
||
| steps: | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '24' | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: npm-packages | ||
|
|
||
| - name: Publish to npmjs | ||
| run: | | ||
| npm publish devextreme-aspnet-data-nojquery-*.tgz --provenance --access public ${{ inputs['dry-run'] && '--dry-run' || '' }} | ||
| npm publish devextreme-aspnet-data-[0-9]*.tgz --provenance --access public ${{ inputs['dry-run'] && '--dry-run' || '' }} | ||
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.