Skip to content

Commit

Permalink
Attempt to build binaries with github actions (#1)
Browse files Browse the repository at this point in the history
* Attempt to build binaries with github actions

* Force hot-off-the-press GHC

* Relax cabal version requirement

* Use different github actions

* Attempt to release built binary

* Put the built binary somewhere more convenient

Also fix an errant "pdf" extension

* Copy the binary after it has been built, not before

* Upload the artifact so it's there to be downloaded

* Fix typo
  • Loading branch information
PeterRugg authored Jan 17, 2024
1 parent 0534f06 commit 1a2eb92
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Generate VIPBundle binary

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
ubuntu_20_04_build:

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
with:
ghc-version: '9.2.1'
#cabal-version: '3.2'

- name: Cache
uses: actions/cache@v3
env:
cache-name: cache-cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: |
cabal update
cabal build --only-dependencies
- name: Build
run: |
cabal build
cp `cabal list-bin vipbundle` vipbundle
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: vipbundle
path: vipbundle

release:
needs: ubuntu_20_04_build
runs-on: [ubuntu-latest]
steps:
- name: Download artifact
uses: actions/download-artifact@master
with:
name: vipbundle
path: ./
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d')"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: build-${{ steps.date.outputs.date }}-${{ github.sha }}
release_name: Build ${{ steps.date.outputs.date }}
body: Latest snapshot (${{ github.sha }})
prerelease: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./vipbundle
asset_name: vipbundle-snapshot-${{ github.sha }}

0 comments on commit 1a2eb92

Please sign in to comment.