-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to build binaries with github actions (#1)
* 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
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} |