|
7 | 7 | description: 'Branch to release'
|
8 | 8 | required: true
|
9 | 9 | default: 'main'
|
| 10 | + dry_run: |
| 11 | + type: boolean |
| 12 | + description: 'Run the workflow in dry-run mode' |
| 13 | + required: false |
| 14 | + default: false |
10 | 15 | npm_tag:
|
11 | 16 | type: choice
|
12 | 17 | description: 'Specify npm tag'
|
|
42 | 47 | jobs:
|
43 | 48 | publish-npm:
|
44 | 49 | if: ${{ inputs.to_release == 'all' || inputs.to_release == 'npm' }}
|
45 |
| - name: Publish NPM Packages and |
| 50 | + name: ${{ inputs.dry_run == true && 'Dry Run - NPM Packages' || 'Publish NPM Packages' }} |
46 | 51 | needs: [build, check]
|
47 | 52 | runs-on: rspack-ubuntu-22.04-large
|
48 | 53 | steps:
|
| 54 | + - name: Show dry-run status |
| 55 | + run: | |
| 56 | + if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then |
| 57 | + echo "🏃♂️ RUNNING IN DRY-RUN MODE - No packages will be published to npm registry" |
| 58 | + echo "==================================================" |
| 59 | + else |
| 60 | + echo "🚀 LIVE MODE - Packages will be published to npm registry" |
| 61 | + echo "========================================" |
| 62 | + fi |
| 63 | +
|
49 | 64 | - name: Checkout
|
50 | 65 | uses: actions/checkout@v4
|
51 | 66 | with:
|
|
73 | 88 | uses: ./.github/actions/move-artifacts
|
74 | 89 |
|
75 | 90 | - name: Publish npm packages
|
| 91 | + if: ${{ github.event.inputs.dry_run == false }} |
76 | 92 | env:
|
77 | 93 | NPM_TOKEN: ${{ secrets.RSLINT_NPM_TOKEN }}
|
78 | 94 | run: |
|
|
81 | 97 |
|
82 | 98 | publish-extesion:
|
83 | 99 | if: ${{ inputs.to_release == 'all' || inputs.to_release == 'extension' }}
|
84 |
| - name: Publish Extensions |
| 100 | + name: ${{ inputs.dry_run == true && 'Dry Run - Extensions' || 'Publish Extensions' }} |
85 | 101 | needs: [build, check]
|
86 | 102 | runs-on: rspack-ubuntu-22.04-large
|
87 | 103 | steps:
|
@@ -112,26 +128,48 @@ jobs:
|
112 | 128 | env:
|
113 | 129 | VSCE_PAT: ${{ secrets.RSLINT_VSCE_PAT }}
|
114 | 130 | run: |
|
115 |
| - if [ "${{ github.event.inputs.extension_type }}" = "pre-release" ]; then |
116 |
| - pnpm publish:vsce --prerelease |
| 131 | + if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then |
| 132 | + echo "🚀 DRY RUN: Building and packaging VS Code extension without publishing..." |
| 133 | + if [ "${{ github.event.inputs.extension_type }}" = "pre-release" ]; then |
| 134 | + pnpm publish:vsce --prerelease --dry-run |
| 135 | + else |
| 136 | + pnpm publish:vsce --dry-run |
| 137 | + fi |
117 | 138 | else
|
118 |
| - pnpm publish:vsce |
| 139 | + if [ "${{ github.event.inputs.extension_type }}" = "pre-release" ]; then |
| 140 | + pnpm publish:vsce --prerelease |
| 141 | + else |
| 142 | + pnpm publish:vsce |
| 143 | + fi |
119 | 144 | fi
|
120 |
| -
|
| 145 | + - name: Upload VSCE artifact |
| 146 | + uses: actions/upload-artifact@v4 |
| 147 | + with: |
| 148 | + path: packages/vscode-extension/rslint-*.vsix |
121 | 149 | - name: Build and publish to Open VSX Registry
|
122 | 150 | # TODO fix the timeout problem while publish to Open VSX Registry
|
123 | 151 | if: false
|
124 | 152 | env:
|
125 | 153 | OVSX_PAT: ${{ secrets.RSLINT_OVSX_PAT }}
|
126 | 154 | run: |
|
127 |
| - if [ "${{ github.event.inputs.extension_type }}" = "pre-release" ]; then |
128 |
| - pnpm publish:ovsx --prerelease |
| 155 | + if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then |
| 156 | + echo "🚀 DRY RUN: Building and packaging for Open VSX Registry without publishing..." |
| 157 | + if [ "${{ github.event.inputs.extension_type }}" = "pre-release" ]; then |
| 158 | + pnpm publish:ovsx --prerelease --dry-run |
| 159 | + else |
| 160 | + pnpm publish:ovsx --dry-run |
| 161 | + fi |
129 | 162 | else
|
130 |
| - pnpm publish:ovsx |
| 163 | + if [ "${{ github.event.inputs.extension_type }}" = "pre-release" ]; then |
| 164 | + pnpm publish:ovsx --prerelease |
| 165 | + else |
| 166 | + pnpm publish:ovsx |
| 167 | + fi |
131 | 168 | fi
|
132 | 169 |
|
133 | 170 | check:
|
134 | 171 | name: Test
|
| 172 | + if: ${{ github.event.inputs.dry_run == false }} |
135 | 173 | needs: build
|
136 | 174 | strategy:
|
137 | 175 | fail-fast: true
|
|
0 commit comments