Skip to content

Commit

Permalink
Merge pull request #42 from nLatt/41-create-an-automatic-release-action
Browse files Browse the repository at this point in the history
41 create an automatic release action
  • Loading branch information
virgile-crtl authored Feb 5, 2023
2 parents 1a0fd50 + aac721b commit d93f542
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 38 deletions.
74 changes: 46 additions & 28 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,56 @@
name: Haskell CI

on: pull_request
on:
pull_request:
branches:
- main
- develop
push:
branches:
- main
- develop

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-haskell@v1
with:
ghc-version: '8.10.3'
cabal-version: '2.4'

- 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 --enable-tests --enable-benchmarks
- name: Build
run: cabal build --enable-tests --enable-benchmarks all
- name: Run tests
run: cabal test all
- uses: actions/checkout@v3
- uses: actions/setup-haskell@v1
with:
ghc-version: "8.10.3"
cabal-version: "2.4"

- 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 --enable-tests --enable-benchmarks
- name: Build
run: cabal build --enable-tests --enable-benchmarks all
- name: Run tests
run: cabal test all

- name: "Build & test"
run: |
cabal build glados;
find . -wholename "*glados/glados" -exec cp {} . \;;
- uses: actions/upload-artifact@v2
with:
name: glados
path: ./glados
25 changes: 25 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "pre-release"

on:
workflow_run:
workflows: ["Haskell CI"]
types: [completed]
branches: [main]

jobs:
pre-release:
name: "Pre Release"
runs-on: "ubuntu-latest"
steps:
- uses: actions/download-artifact@v2
with:
name: glados

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: |
./glados
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ cabal.project.local~
.HTF/
.ghc.environment.*
*.tix
glados
tmp
packagedb
packagedb
5 changes: 0 additions & 5 deletions CHANGELOG.md

This file was deleted.

4 changes: 0 additions & 4 deletions cabal.project

This file was deleted.

0 comments on commit d93f542

Please sign in to comment.