Skip to content

Commit 20a5d5d

Browse files
authored
Optionally publish packages definitely in the hackage workflow (#2689)
* Optionally publish packages defintely Via a manual run setting publish=="true" * Update hackage release instructions
1 parent 83d26ec commit 20a5d5d

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/hackage.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ concurrency:
88
on:
99
workflow_dispatch:
1010
inputs:
11-
upload-candidates:
11+
upload:
1212
description: 'Whether packages should be uploaded'
1313
required: true
1414
default: 'false'
15+
publish:
16+
description: 'Wheter packages should be published as definitive'
17+
required: true
18+
default: 'false'
1519
push:
1620
branches:
1721
- '*-hackage'
@@ -20,7 +24,7 @@ jobs:
2024
check-and-upload-tarballs:
2125
runs-on: ubuntu-latest
2226
strategy:
23-
fail-fast: ${{ github.event.inputs.upload-candidates != 'false' }}
27+
fail-fast: ${{ github.event.inputs.upload != 'false' }}
2428
matrix:
2529
package: ["hie-compat", "hls-graph", "shake-bench",
2630
"hls-plugin-api", "ghcide", "hls-test-utils",
@@ -138,8 +142,10 @@ jobs:
138142
name: ${{ matrix.package }}
139143
path: ${{ steps.generate-dist-tarball.outputs.path }}
140144

141-
upload-candidate:
142-
if: github.event.inputs.upload-candidates != 'false'
145+
upload-package:
146+
# Runs triggered by *-hackage branches will upload packages
147+
# cause inputs are blank when the workflow is not triggered manually
148+
if: github.event.inputs.upload != 'false'
143149
needs: check-and-upload-tarballs
144150
runs-on: ubuntu-latest
145151
steps:
@@ -156,4 +162,5 @@ jobs:
156162
with:
157163
hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }}
158164
packagesPath: packages
159-
publish: false
165+
# runs triggered by *-hackage branches will not publish packages definitely
166+
publish: {{ github.event.inputs.publish == 'true' }}

docs/contributing/releases.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ and it is being used in nix environments.
4545
- [ ] create ${version}-hackage branch to trigger the hackage github workflow which will upload all changed packages to hackage as candidates
4646
- [ ] for new plugins or packages, update hackage uploaders to add the author of the plugin/package and some hls maintainer(s) other than the owner of the hackage api key used to upload them (it has to be done by the owner of the api key, actually @pepeiborra)
4747
- [ ] check manually candidates in hackage
48-
- [ ] publish them definitely
48+
- [ ] publish them definitely triggering a manual run of the hackage workflow setting the upload and publish inputs to `true`
4949

5050
### ghcup release
5151

0 commit comments

Comments
 (0)