Skip to content

Merge pull request #33 from maestro-org/drop-v0 #10

Merge pull request #33 from maestro-org/drop-v0

Merge pull request #33 from maestro-org/drop-v0 #10

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
uses: ./.github/workflows/haskell.yml
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:
MAESTRO_SDK_VERSION: ${{needs.build.outputs.MAESTRO_SDK_VERSION}}
run: |
export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
SEMANTIC_VERSION=v${MAESTRO_SDK_VERSION/#maestro-sdk-}
TAGS=$(git describe --tags)
GIT_REVISION=$(git rev-parse HEAD)
CI_BUILD_TIME=$(date --iso-8601=seconds --utc)
echo "MAESTRO_SDK_VERSION: ${{ env.MAESTRO_SDK_VERSION }}"
echo "SEMANTIC_VERSION: $SEMANTIC_VERSION"
echo "TAGS: $TAGS"
echo "GIT_REVISION: $GIT_REVISION"
echo "CI_BUILD_TIME: $CI_BUILD_TIME"
HADDOCK_FILE=${{ env.MAESTRO_SDK_VERSION }}-haddock.tar
set -x
mv ./artifacts/artifact.tar ./artifacts/${HADDOCK_FILE}
gh release create \
--generate-notes \
--verify-tag \
--draft \
"${SEMANTIC_VERSION}" \
"./artifacts/${{ env.MAESTRO_SDK_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.MAESTRO_SDK_VERSION }}.tar.gz)"
- name: Setup haskell tooling
uses: haskell/actions/setup@v2
with:
ghc-version: '8.10.7'
cabal-version: '3.8'
enable-stack: true
- name: Update dependencies (cabal)
run: cabal v2-update
# - name: Publish to Hackage (cabal)
# run: |
# dir=$(mktemp -d dist-docs.XXXXXX)
# trap 'rm -r "$dir"' EXIT
# cabal v2-haddock --builddir="$dir" --haddock-for-hackage --enable-doc
# cabal upload -d --publish $dir/*-docs.tar.gz