Skip to content

Merge pull request #80 from geniusyield/79-fix-config-json-parser #13

Merge pull request #80 from geniusyield/79-fix-config-json-parser

Merge pull request #80 from geniusyield/79-fix-config-json-parser #13

Workflow file for this run

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/download-artifact@v3
name: Download source distribution file artifact
with:
name: source-distribution-file
path: ./artifacts
- uses: actions/download-artifact@v3
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)"