Skip to content

Commit

Permalink
Improve release CI (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbg authored Feb 2, 2022
1 parent aadf292 commit 43e7ef9
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
tags:
paths:
- '.github/workflows/build.yml'
- "compiler/**"
Expand All @@ -28,7 +29,7 @@ jobs:
id: "install-haskell"
uses: haskell/actions/setup@v1
with:
ghc-version: "8.10.4"
ghc-version: "8.10.7"
enable-stack: true
stack-version: "latest"

Expand Down Expand Up @@ -60,19 +61,24 @@ jobs:
stack --no-terminal build --only-dependencies --test --bench --haddock --fast --system-ghc
- name: Build and install
id: build
env:
ARTIFACT_NAME: plc-llvm-${{ runner.os }}-${{ runner.arch }}.tar.gz
run: |
mkdir -p ./bin
cp ./compiler/rts/rts.c ./bin/rts.c
mkdir -p ./bin/tiny_sha3
cp -r ./compiler/rts/tiny_sha3 ./bin/
stack --no-terminal build --test --bench --haddock --fast --system-ghc --no-run-tests --no-run-benchmarks --copy-bins --local-bin-path=./bin/
tar acvf plc-llvm.tar.gz -C bin .
tar acvf $ARTIFACT_NAME -C bin .
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: plc-llvm-${{ runner.os }}.tar.gz
path: './plc-llvm.tar.gz'
name: plc-llvm-${{ runner.os }}-${{ runner.arch }}.tar.gz
path: plc-llvm-${{ runner.os }}-${{ runner.arch }}.tar.gz
if-no-files-found: error

- name: Run tests
Expand All @@ -89,14 +95,14 @@ jobs:
fail_on: 'test failures'

- name: Upload release
if: ${{ github.ref == 'refs/heads/main' }}
uses: svenstaro/upload-release-action@v2
if: startsWith(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'plc-llvm.tar.gz'
asset_name: 'plc-llvm-${{ runner.os }}.tar.gz'
tag: 'latest-plc-llvm'
overwrite: true
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
artifactErrorsFailBuild: true
artifacts: plc-llvm-${{ runner.os }}-${{ runner.arch }}.tar.gz
generateReleaseNotes: true

- name: Publish documentation
if: ${{ github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' }}
Expand Down

0 comments on commit 43e7ef9

Please sign in to comment.