-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (52 loc) · 1.69 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
uses: ./.github/workflows/haskell.yml
secrets: inherit
release:
runs-on: ubuntu-22.04
needs: build
steps:
- name: Checkout source code
uses: actions/checkout@v3
- uses: actions/[email protected]
name: Download source distribution file artifact
with:
name: source-distribution-file
path: ./artifacts
- uses: actions/[email protected]
name: Download haddock artifact
with:
name: github-pages
path: ./artifacts
- name: Create release draft (GitHub)
env:
VERSION: ${{needs.build.outputs.VERSION}}
run: |
export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
SEMANTIC_VERSION=v${VERSION/#geniusyield-dex-api-}
TAGS=$(git describe --tags)
GIT_REVISION=$(git rev-parse HEAD)
CI_BUILD_TIME=$(date --iso-8601=seconds --utc)
echo "VERSION: ${{ env.VERSION }}"
echo "SEMANTIC_VERSION: $SEMANTIC_VERSION"
echo "TAGS: $TAGS"
echo "GIT_REVISION: $GIT_REVISION"
echo "CI_BUILD_TIME: $CI_BUILD_TIME"
HADDOCK_FILE=${{ env.VERSION }}-haddock.tar
set -x
mv ./artifacts/artifact.tar ./artifacts/${HADDOCK_FILE}
gh release create \
--generate-notes \
--verify-tag \
--draft \
"${SEMANTIC_VERSION}" \
"./artifacts/${{ env.VERSION }}.tar.gz#Source distribution file (tar.gz)" \
"./artifacts/${HADDOCK_FILE}#Haddock (tar)"
echo "::notice::Succesfully created release draft ${SEMANTIC_VERSION} from ${GIT_REVISION}. (Uploaded: ${{ env.VERSION }}.tar.gz)"