Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to build binaries with github actions #1

Merged
merged 9 commits into from
Jan 17, 2024
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 }}
Loading