Skip to content

Commit 0157ba0

Browse files
alexslavrCopilot
andcommitted
feat: enhance publish workflow with dry-run option and restructure jobs
Co-authored-by: Copilot <copilot@github.com>
1 parent c513ead commit 0157ba0

1 file changed

Lines changed: 27 additions & 14 deletions

File tree

.github/workflows/publish.yml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Publish
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
dry-run:
7+
description: 'Dry run (skip actual publishing)'
8+
type: boolean
9+
default: false
510

611
permissions:
712
id-token: write
@@ -15,13 +20,12 @@ env:
1520

1621
jobs:
1722

18-
publish:
23+
pack:
1924
runs-on: ubuntu-latest
2025

2126
env:
2227
RELEASE_KEY_SECRET: ${{ secrets.RELEASE_KEY_SECRET }}
2328
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
24-
IS_TAG: ${{ startsWith(github.ref, 'refs/tags/') }}
2529

2630
steps:
2731
- uses: actions/setup-dotnet@v4
@@ -31,11 +35,6 @@ jobs:
3135
3.1
3236
8.0
3337
34-
- uses: actions/setup-node@v4
35-
with:
36-
node-version: 'lts/*'
37-
registry-url: 'https://registry.npmjs.org'
38-
3938
- uses: actions/checkout@v4
4039

4140
- name: Decrypt signing key
@@ -65,12 +64,6 @@ jobs:
6564
if: ${{ env.RELEASE_KEY_SECRET != '' }}
6665
run: dotnet pack net/DevExtreme.AspNet.Data --configuration=Release --include-symbols
6766

68-
- name: Publish to npmjs
69-
if: ${{ env.IS_TAG == 'true' }}
70-
run: |
71-
npm publish devextreme-aspnet-data-nojquery-*.tgz --provenance --access public
72-
npm publish devextreme-aspnet-data-*.tgz --provenance --access public
73-
7467
- name: Upload NuGet packages as artifacts
7568
if: ${{ env.RELEASE_KEY_SECRET != '' }}
7669
uses: actions/upload-artifact@v4
@@ -79,8 +72,28 @@ jobs:
7972
path: net/DevExtreme.AspNet.Data/bin/Release/*.nupkg
8073

8174
- name: Upload npm packages as artifacts
82-
if: ${{ env.IS_TAG != 'true' }}
8375
uses: actions/upload-artifact@v4
8476
with:
8577
name: npm-packages
8678
path: devextreme-aspnet-data-*.tgz
79+
80+
publish:
81+
runs-on: ubuntu-latest
82+
needs: pack
83+
if: startsWith(github.ref, 'refs/tags/')
84+
environment: npmjs
85+
86+
steps:
87+
- uses: actions/setup-node@v4
88+
with:
89+
node-version: '24'
90+
registry-url: 'https://registry.npmjs.org'
91+
92+
- uses: actions/download-artifact@v4
93+
with:
94+
name: npm-packages
95+
96+
- name: Publish to npmjs
97+
run: |
98+
npm publish devextreme-aspnet-data-nojquery-*.tgz --provenance --access public ${{ inputs.dry-run && '--dry-run' || '' }}
99+
npm publish devextreme-aspnet-data-[0-9]*.tgz --provenance --access public ${{ inputs.dry-run && '--dry-run' || '' }}

0 commit comments

Comments
 (0)