From 2c35472f6060bbef73dc157ab1052a1fb55b7159 Mon Sep 17 00:00:00 2001 From: Nydragon <6582485n@proton.me> Date: Sun, 5 Feb 2023 17:29:09 +0100 Subject: [PATCH 1/2] [Fix] fix actions --- .github/workflows/haskell.yml | 18 ++------------ .github/workflows/pre-release.yml | 41 +++++++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 7f5a8e8..5cc133f 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -2,13 +2,9 @@ name: Haskell CI on: pull_request: - branches: - - main - - develop + branches: [main, develop] push: - branches: - - main - - develop + branches: [main, develop] permissions: contents: read @@ -44,13 +40,3 @@ jobs: 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 diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index b95aeb5..a2cfe5c 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -1,13 +1,44 @@ -name: "pre-release" +name: "Automatic Release" on: - workflow_run: - workflows: ["Haskell CI"] - types: [completed] - branches: [main] + push: + branches: [41-create-an-automatic-release-action] 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: "Build & test" + run: | + cabal update + cabal build glados; + find . -wholename "*glados/glados" -exec cp {} . \;; + + - uses: actions/upload-artifact@v2 + with: + name: glados + path: ./glados + pre-release: + needs: build name: "Pre Release" runs-on: "ubuntu-latest" steps: From eef8f2d113eeb84b1252ff1b15ae1b165077ecb6 Mon Sep 17 00:00:00 2001 From: Nydragon <6582485n@proton.me> Date: Sun, 5 Feb 2023 17:38:12 +0100 Subject: [PATCH 2/2] [Fix] remove some triggers --- .github/workflows/haskell.yml | 2 -- .github/workflows/pre-release.yml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 5cc133f..2967e54 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -3,8 +3,6 @@ name: Haskell CI on: pull_request: branches: [main, develop] - push: - branches: [main, develop] permissions: contents: read diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index a2cfe5c..53adaf1 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -2,7 +2,7 @@ name: "Automatic Release" on: push: - branches: [41-create-an-automatic-release-action] + branches: [main] jobs: build: