Skip to content

Release

Release #49

Workflow file for this run

name: Release
on: workflow_dispatch
jobs:
ci:
uses: ./.github/workflows/ci.yml
release:
runs-on: ubuntu-latest
needs:
- ci
env:
VERSION: ${{ needs.ci.outputs.version }}
steps:
-
uses: actions/checkout@v4
-
uses: actions/download-artifact@v3
with:
name: fourmolu-binary-ubuntu-latest
path: ./bin/
-
uses: actions/download-artifact@v3
with:
name: fourmolu-binary-macos-latest
path: ./bin/
-
uses: actions/download-artifact@v3
with:
name: fourmolu-sdist
path: ./sdist/
-
name: Load Hackage token secret name
id: hackage_token_secret
run: |
USERNAME="$(echo "${GITHUB_ACTOR}" | tr '[:lower:]' '[:upper:]' | tr '-' '_')"
echo "name=HACKAGE_TOKEN_${USERNAME}" >> "${GITHUB_OUTPUT}"
-
name: Get CHANGELOG section
run: |
if [[ "$(head -n 1 CHANGELOG.md)" != "## Fourmolu ${VERSION}" ]]; then
echo "CHANGELOG doesn't look updated" >&2
exit 1
fi
sed '1 d; /^## Fourmolu/,$ d' CHANGELOG.md > /tmp/changelog-body
-
uses: haskell-actions/hackage-publish@v1
with:
hackageToken: ${{ secrets[steps.hackage_token_secret.outputs.name] }}
packagesPath: ./sdist
-
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.VERSION }}
body_path: /tmp/changelog-body
draft: true
target_commitish: ${{ github.sha }}
files: |
bin/fourmolu-${{ env.VERSION }}-linux-x86_64
bin/fourmolu-${{ env.VERSION }}-osx-x86_64
fail_on_unmatched_files: true