From ddf98dcac2351a67ff298bf6a7c8af051c062561 Mon Sep 17 00:00:00 2001 From: justinwoo Date: Thu, 3 Nov 2022 14:15:58 +0200 Subject: [PATCH] create and upload binaries on tags --- .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++++++ .gitignore | 3 ++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0a17f1a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: Main + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ${{ matrix.os }} + matrix: + os: + - ubuntu-latest + - macOS-latest + cabal: + - "3.6.2.0" + ghc: + - "9.2.3" + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Haskell + uses: haskell/actions/setup@v1.2 + id: setup-haskell-cabal + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: ${{ matrix.cabal }} + + - name: Build + run: cabal install exe:tie --install-method=copy --overwrite-policy=always --installdir=out + + - name: Test + run: ./out/tie --help + + - name: Prepare archive + run: tar -zcvf ./${{ matrix.os }}.tar.gz -C out tie + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: ./${{ matrix.os }}.tar.gz diff --git a/.gitignore b/.gitignore index 1215b6e..184d256 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ dist-newstyle/ .DS_Store out/ -cabal.project.local* \ No newline at end of file +cabal.project.local* +*.tar.gz