Skip to content

Commit e1670b8

Browse files
committed
ci: Sync haskell-ci-hackage.patch with xmonad
1 parent 6ada774 commit e1670b8

File tree

2 files changed

+41
-21
lines changed

2 files changed

+41
-21
lines changed

.github/workflows/haskell-ci-hackage.patch

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ set in GitHub repository secrets.
4545
- compiler: ghc-8.10.4
4646
allow-failure: false
4747
- compiler: ghc-8.8.4
48-
@@ -171,8 +181,56 @@
48+
@@ -171,8 +181,66 @@
4949
${CABAL} -vnormal check
5050
- name: haddock
5151
run: |
@@ -69,37 +69,47 @@ set in GitHub repository secrets.
6969
+ if: matrix.upload && github.event_name == 'release'
7070
+ run: |
7171
+ set -ex
72+
+ PACKAGE_VERSION="${PACKAGE_VERSION#v}"
7273
+ curl \
7374
+ --silent --show-error --fail \
7475
+ --header "Accept: text/plain" \
75-
+ --header "Authorization: X-ApiKey ${{ secrets.HACKAGE_API_KEY }}" \
76-
+ --form package=@$GITHUB_WORKSPACE/sdist/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.tar.gz \
76+
+ --header "Authorization: X-ApiKey $HACKAGE_API_KEY" \
77+
+ --form package=@"${GITHUB_WORKSPACE}/sdist/${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.gz" \
7778
+ https://hackage.haskell.org/packages/candidates/
7879
+ curl \
7980
+ --silent --show-error --fail \
8081
+ -X PUT \
8182
+ --header "Accept: text/plain" \
82-
+ --header "Authorization: X-ApiKey ${{ secrets.HACKAGE_API_KEY }}" \
83+
+ --header "Authorization: X-ApiKey $HACKAGE_API_KEY" \
8384
+ --header "Content-Type: application/x-tar" \
8485
+ --header "Content-Encoding: gzip" \
85-
+ --data-binary @$GITHUB_WORKSPACE/haddock/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}-docs.tar.gz \
86-
+ https://hackage.haskell.org/package/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}/candidate/docs
86+
+ --data-binary @"${GITHUB_WORKSPACE}/haddock/${PACKAGE_NAME}-${PACKAGE_VERSION}-docs.tar.gz" \
87+
+ https://hackage.haskell.org/package/${PACKAGE_NAME}-${PACKAGE_VERSION}/candidate/docs
88+
+ env:
89+
+ HACKAGE_API_KEY: ${{ secrets.HACKAGE_API_KEY }}
90+
+ PACKAGE_NAME: ${{ github.event.repository.name }}
91+
+ PACKAGE_VERSION: ${{ github.event.release.tag_name }}
8792
+ - name: hackage upload (release)
8893
+ if: matrix.upload && github.event_name == 'workflow_dispatch'
8994
+ run: |
9095
+ set -ex
96+
+ PACKAGE_VERSION="${PACKAGE_VERSION#v}"
9197
+ curl \
9298
+ --silent --show-error --fail \
9399
+ --header "Accept: text/plain" \
94-
+ --header "Authorization: X-ApiKey ${{ secrets.HACKAGE_API_KEY }}" \
95-
+ --form package=@$GITHUB_WORKSPACE/sdist/${{ github.event.repository.name }}-${{ github.event.inputs.version }}.tar.gz \
100+
+ --header "Authorization: X-ApiKey $HACKAGE_API_KEY" \
101+
+ --form package=@"${GITHUB_WORKSPACE}/sdist/${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.gz" \
96102
+ https://hackage.haskell.org/packages/
97103
+ curl \
98104
+ --silent --show-error --fail \
99105
+ -X PUT \
100106
+ --header "Accept: text/plain" \
101-
+ --header "Authorization: X-ApiKey ${{ secrets.HACKAGE_API_KEY }}" \
107+
+ --header "Authorization: X-ApiKey $HACKAGE_API_KEY" \
102108
+ --header "Content-Type: application/x-tar" \
103109
+ --header "Content-Encoding: gzip" \
104-
+ --data-binary @$GITHUB_WORKSPACE/haddock/${{ github.event.repository.name }}-${{ github.event.inputs.version }}-docs.tar.gz \
105-
+ https://hackage.haskell.org/package/${{ github.event.repository.name }}-${{ github.event.inputs.version }}/docs
110+
+ --data-binary @"${GITHUB_WORKSPACE}/haddock/${PACKAGE_NAME}-${PACKAGE_VERSION}-docs.tar.gz" \
111+
+ https://hackage.haskell.org/package/${PACKAGE_NAME}-${PACKAGE_VERSION}/docs
112+
+ env:
113+
+ HACKAGE_API_KEY: ${{ secrets.HACKAGE_API_KEY }}
114+
+ PACKAGE_NAME: ${{ github.event.repository.name }}
115+
+ PACKAGE_VERSION: ${{ github.event.inputs.version }}

.github/workflows/haskell-ci.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,37 +200,47 @@ jobs:
200200
if: matrix.upload && github.event_name == 'release'
201201
run: |
202202
set -ex
203+
PACKAGE_VERSION="${PACKAGE_VERSION#v}"
203204
curl \
204205
--silent --show-error --fail \
205206
--header "Accept: text/plain" \
206-
--header "Authorization: X-ApiKey ${{ secrets.HACKAGE_API_KEY }}" \
207-
--form package=@$GITHUB_WORKSPACE/sdist/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.tar.gz \
207+
--header "Authorization: X-ApiKey $HACKAGE_API_KEY" \
208+
--form package=@"${GITHUB_WORKSPACE}/sdist/${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.gz" \
208209
https://hackage.haskell.org/packages/candidates/
209210
curl \
210211
--silent --show-error --fail \
211212
-X PUT \
212213
--header "Accept: text/plain" \
213-
--header "Authorization: X-ApiKey ${{ secrets.HACKAGE_API_KEY }}" \
214+
--header "Authorization: X-ApiKey $HACKAGE_API_KEY" \
214215
--header "Content-Type: application/x-tar" \
215216
--header "Content-Encoding: gzip" \
216-
--data-binary @$GITHUB_WORKSPACE/haddock/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}-docs.tar.gz \
217-
https://hackage.haskell.org/package/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}/candidate/docs
217+
--data-binary @"${GITHUB_WORKSPACE}/haddock/${PACKAGE_NAME}-${PACKAGE_VERSION}-docs.tar.gz" \
218+
https://hackage.haskell.org/package/${PACKAGE_NAME}-${PACKAGE_VERSION}/candidate/docs
219+
env:
220+
HACKAGE_API_KEY: ${{ secrets.HACKAGE_API_KEY }}
221+
PACKAGE_NAME: ${{ github.event.repository.name }}
222+
PACKAGE_VERSION: ${{ github.event.release.tag_name }}
218223
- name: hackage upload (release)
219224
if: matrix.upload && github.event_name == 'workflow_dispatch'
220225
run: |
221226
set -ex
227+
PACKAGE_VERSION="${PACKAGE_VERSION#v}"
222228
curl \
223229
--silent --show-error --fail \
224230
--header "Accept: text/plain" \
225-
--header "Authorization: X-ApiKey ${{ secrets.HACKAGE_API_KEY }}" \
226-
--form package=@$GITHUB_WORKSPACE/sdist/${{ github.event.repository.name }}-${{ github.event.inputs.version }}.tar.gz \
231+
--header "Authorization: X-ApiKey $HACKAGE_API_KEY" \
232+
--form package=@"${GITHUB_WORKSPACE}/sdist/${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.gz" \
227233
https://hackage.haskell.org/packages/
228234
curl \
229235
--silent --show-error --fail \
230236
-X PUT \
231237
--header "Accept: text/plain" \
232-
--header "Authorization: X-ApiKey ${{ secrets.HACKAGE_API_KEY }}" \
238+
--header "Authorization: X-ApiKey $HACKAGE_API_KEY" \
233239
--header "Content-Type: application/x-tar" \
234240
--header "Content-Encoding: gzip" \
235-
--data-binary @$GITHUB_WORKSPACE/haddock/${{ github.event.repository.name }}-${{ github.event.inputs.version }}-docs.tar.gz \
236-
https://hackage.haskell.org/package/${{ github.event.repository.name }}-${{ github.event.inputs.version }}/docs
241+
--data-binary @"${GITHUB_WORKSPACE}/haddock/${PACKAGE_NAME}-${PACKAGE_VERSION}-docs.tar.gz" \
242+
https://hackage.haskell.org/package/${PACKAGE_NAME}-${PACKAGE_VERSION}/docs
243+
env:
244+
HACKAGE_API_KEY: ${{ secrets.HACKAGE_API_KEY }}
245+
PACKAGE_NAME: ${{ github.event.repository.name }}
246+
PACKAGE_VERSION: ${{ github.event.inputs.version }}

0 commit comments

Comments
 (0)