From a4452108db6bcaa365336111437b9ccab6d6e787 Mon Sep 17 00:00:00 2001 From: Nydragon <6582485n@proton.me> Date: Sat, 4 Feb 2023 23:52:41 +0100 Subject: [PATCH 1/6] [Build] add pre-release action --- .github/workflows/pre-release.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/pre-release.yml diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml new file mode 100644 index 0000000..48afe4b --- /dev/null +++ b/.github/workflows/pre-release.yml @@ -0,0 +1,21 @@ +name: "pre-release" + +on: push + +jobs: + pre-release: + name: "Pre Release" + runs-on: "ubuntu-latest" + + steps: + # ... + - name: "Build & test" + run: | + echo "done!" + + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" + prerelease: true + title: "Development Build" From 8bc5f924f31c843927d086f73792969e2f6affe3 Mon Sep 17 00:00:00 2001 From: Nydragon <6582485n@proton.me> Date: Sun, 5 Feb 2023 16:07:06 +0100 Subject: [PATCH 2/6] [Build] implement pre-release --- .github/workflows/haskell.yml | 60 +++++++++++++++++-------------- .github/workflows/pre-release.yml | 11 ++++-- .gitignore | 3 +- 3 files changed, 44 insertions(+), 30 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 29d035d..68597fb 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -1,38 +1,46 @@ 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' + - 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: 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: 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 diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 48afe4b..a478f2b 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -1,6 +1,9 @@ name: "pre-release" -on: push +on: + push: + branches: + - main jobs: pre-release: @@ -8,10 +11,10 @@ jobs: runs-on: "ubuntu-latest" steps: - # ... - name: "Build & test" run: | - echo "done!" + cabal build glados; + find . -wholename "*glados/glados" -exec cp {} . \;; - uses: "marvinpinto/action-automatic-releases@latest" with: @@ -19,3 +22,5 @@ jobs: automatic_release_tag: "latest" prerelease: true title: "Development Build" + files: | + ./glados diff --git a/.gitignore b/.gitignore index 2766f39..b388f97 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ cabal.project.local cabal.project.local~ .HTF/ .ghc.environment.* -*.tix \ No newline at end of file +*.tix +glados \ No newline at end of file From a5efb7d4551aa85c37278afd8266f3f39e7a7e64 Mon Sep 17 00:00:00 2001 From: Nydragon <6582485n@proton.me> Date: Sun, 5 Feb 2023 16:09:41 +0100 Subject: [PATCH 3/6] [Refactor] change cond --- .github/workflows/pre-release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index a478f2b..b02805a 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -1,9 +1,10 @@ name: "pre-release" on: - push: - branches: - - main + push + # push: + # branches: + # - main jobs: pre-release: From ca3ba87214c475b336c3182a6e492a4433331baf Mon Sep 17 00:00:00 2001 From: Nydragon <6582485n@proton.me> Date: Sun, 5 Feb 2023 16:16:34 +0100 Subject: [PATCH 4/6] [Refacto] change layout --- .github/workflows/pre-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index b02805a..d50e347 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -19,7 +19,7 @@ jobs: - uses: "marvinpinto/action-automatic-releases@latest" with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" + repo_token: "${{ secrets.TOKEN }}" automatic_release_tag: "latest" prerelease: true title: "Development Build" From bcfad03110cf2a683691e8b92eadbfddc4453e18 Mon Sep 17 00:00:00 2001 From: Nydragon <6582485n@proton.me> Date: Sun, 5 Feb 2023 16:21:36 +0100 Subject: [PATCH 5/6] [Build] add an automatic release system --- .github/workflows/haskell.yml | 11 +++++++++++ .github/workflows/pre-release.yml | 16 +++++++--------- CHANGELOG.md | 5 ----- cabal.project | 4 ---- 4 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 CHANGELOG.md delete mode 100644 cabal.project diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 68597fb..3cc778f 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -44,3 +44,14 @@ jobs: run: cabal build --enable-tests --enable-benchmarks all - name: Run tests run: cabal test all + + - 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 diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index d50e347..b95aeb5 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -1,21 +1,19 @@ name: "pre-release" on: - push - # push: - # branches: - # - main + workflow_run: + workflows: ["Haskell CI"] + types: [completed] + branches: [main] jobs: pre-release: name: "Pre Release" runs-on: "ubuntu-latest" - steps: - - name: "Build & test" - run: | - cabal build glados; - find . -wholename "*glados/glados" -exec cp {} . \;; + - uses: actions/download-artifact@v2 + with: + name: glados - uses: "marvinpinto/action-automatic-releases@latest" with: diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index e837040..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -# Revision history for GLaDOS2023 - -## 0.1.0.0 -- YYYY-mm-dd - -* First version. Released on an unsuspecting world. diff --git a/cabal.project b/cabal.project deleted file mode 100644 index f36ce9b..0000000 --- a/cabal.project +++ /dev/null @@ -1,4 +0,0 @@ -packages : ./GLaDOS2023.cabal -tests: True -coverage: True -library-coverage: True \ No newline at end of file From aac721be38c9c03748df92b134b2ebbbbf9e132a Mon Sep 17 00:00:00 2001 From: Nydragon <6582485n@proton.me> Date: Sun, 5 Feb 2023 17:07:55 +0100 Subject: [PATCH 6/6] [Fix] remove unnecessary directive --- .github/workflows/haskell.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 3cc778f..7f5a8e8 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -47,7 +47,6 @@ jobs: - name: "Build & test" run: | - cabal update; cabal build glados; find . -wholename "*glados/glados" -exec cp {} . \;;