Skip to content

Release

Release #13

Workflow file for this run

name: Release
on: workflow_dispatch
jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Generate release tag
id: tag
run: |
echo "::set-output name=release_tag::UserBuild_$(date +"%Y.%m.%d_%H-%M")"
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: ${{ github.ref_name }}
tag_name: ${{ steps.tag.outputs.release_tag }}
draft: false
prerelease: false
generate_release_notes: false
build_artifact:
needs: create_release
name: ${{ matrix.os }}/GHC ${{ matrix.ghc }}/${{ github.ref }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, macOS-latest, windows-latest]
os: [ubuntu-latest, macOS-latest]
ghc-version: ['latest']
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up GHC ${{ matrix.ghc-version }}
uses: haskell/actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc-version }}
# Defaults, added for clarity:
cabal-version: 'latest'
cabal-update: true
- name: Freeze
run: |
cabal freeze
- name: Cache ~/.cabal/store
uses: actions/cache@v1
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
- name: Build binary
run: |
git config --global --add safe.directory $(realpath .)
mkdir dist
cabal install exe:indigo --install-method=copy --overwrite-policy=always --installdir=dist
- if: matrix.os == 'windows-latest'
name: Set extension to .exe on Windows
run: echo "::set-env name=EXT::.exe"
- name: Set binary path name
run: echo "::set-env name=BINARY_PATH::./dist/indigo${{ env.EXT }}"
# - name: Compress binary
# uses: svenstaro/[email protected]
# with:
# file: ${{ env.BINARY_PATH }}
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.create_release.outputs.tag-name }}
files: ${{ env.BINARY_PATH }}
# - name: Upload Release Asset
# id: upload-release-asset
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.get_release_info.outputs.upload_url }}
# asset_path: ${{ env.BINARY_PATH }}
# asset_name: indigo-HEAD-${{ runner.os }}-ghc-${{ matrix.ghc }}${{ env.EXT }}
# asset_content_type: application/octet-stream