Prepare for release v0.21.0.0 #31
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
create_release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
outputs: | |
version: ${{ steps.get_version.outputs.VERSION }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: CHANGELOG.md | |
draft: false | |
prerelease: false | |
build: | |
name: Build and Upload Release Asset | |
needs: create_release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
with: | |
ghc-version: '9.6.6' | |
enable-stack: 'true' | |
stack-version: 'latest' | |
- name: Compute Cache Key | |
id: cache_key | |
run: echo "key=$(grep -v '^version:' package.yaml | sha256sum | cut -d ' ' -f1)" >> $GITHUB_ENV | |
- name: Cache Stack dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.stack | |
!~/.stack/programs | |
./.stack-work | |
key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml') }}-${{ env.key }} | |
restore-keys: | | |
${{ runner.os }}-stack- | |
- name: Cache fpm gems | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gem | |
key: ${{ runner.os }}-gem | |
- name: Install fpm | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ruby ruby-dev rubygems build-essential | |
sudo gem install --no-document fpm | |
- name: Build and Package | |
id: build_package | |
run: | | |
chmod +x ./reposcripts/package.sh | |
PACKAGE_PATH=$(./reposcripts/package.sh | tail -n1) | |
echo "package_path=$PACKAGE_PATH" >> $GITHUB_OUTPUT | |
echo "Package path: $PACKAGE_PATH" | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ steps.build_package.outputs.package_path }} |