From f0da651fde6399f62321e573c134661845e4272e Mon Sep 17 00:00:00 2001 From: Javier Neira Date: Thu, 3 Feb 2022 13:56:58 +0100 Subject: [PATCH 1/2] Optionally publish packages defintely Via a manual run setting publish=="true" --- .github/workflows/hackage.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml index 5645f9f0e8..71be69f74f 100644 --- a/.github/workflows/hackage.yml +++ b/.github/workflows/hackage.yml @@ -8,10 +8,14 @@ concurrency: on: workflow_dispatch: inputs: - upload-candidates: + upload: description: 'Whether packages should be uploaded' required: true default: 'false' + publish: + description: 'Wheter packages should be published as definitive' + required: true + default: 'false' push: branches: - '*-hackage' @@ -20,7 +24,7 @@ jobs: check-and-upload-tarballs: runs-on: ubuntu-latest strategy: - fail-fast: ${{ github.event.inputs.upload-candidates != 'false' }} + fail-fast: ${{ github.event.inputs.upload != 'false' }} matrix: package: ["hie-compat", "hls-graph", "shake-bench", "hls-plugin-api", "ghcide", "hls-test-utils", @@ -138,8 +142,10 @@ jobs: name: ${{ matrix.package }} path: ${{ steps.generate-dist-tarball.outputs.path }} - upload-candidate: - if: github.event.inputs.upload-candidates != 'false' + upload-package: + # Runs triggered by *-hackage branches will upload packages + # cause inputs are blank when the workflow is not triggered manually + if: github.event.inputs.upload != 'false' needs: check-and-upload-tarballs runs-on: ubuntu-latest steps: @@ -156,4 +162,5 @@ jobs: with: hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }} packagesPath: packages - publish: false + # runs triggered by *-hackage branches will not publish packages definitely + publish: {{ github.event.inputs.publish == 'true' }} From 0f71106f89fd76400bc982f36511dd3da91c0e82 Mon Sep 17 00:00:00 2001 From: Javier Neira Date: Thu, 3 Feb 2022 14:11:00 +0100 Subject: [PATCH 2/2] Update hackage release instructions --- docs/contributing/releases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/releases.md b/docs/contributing/releases.md index 728cba90e0..ca1c78a143 100644 --- a/docs/contributing/releases.md +++ b/docs/contributing/releases.md @@ -45,7 +45,7 @@ and it is being used in nix environments. - [ ] create ${version}-hackage branch to trigger the hackage github workflow which will upload all changed packages to hackage as candidates - [ ] 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) - [ ] check manually candidates in hackage -- [ ] publish them definitely +- [ ] publish them definitely triggering a manual run of the hackage workflow setting the upload and publish inputs to `true` ### ghcup release