This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 3a3a6fbd0 ci(bindings/haskell): add release workflow (#3082)
3a3a6fbd0 is described below

commit 3a3a6fbd03295ced4528061c78733a12d7b05b0a
Author: Mingzhuo Yin <[email protected]>
AuthorDate: Fri Sep 15 12:54:25 2023 +0800

    ci(bindings/haskell): add release workflow (#3082)
    
    * ci(bindings/haskell): add release workflow
    
    Signed-off-by: silver-ymz <[email protected]>
    
    * use 1password to load secret token
    
    Signed-off-by: silver-ymz <[email protected]>
    
    ---------
    
    Signed-off-by: silver-ymz <[email protected]>
---
 .github/workflows/bindings_haskell.yml | 55 ++++++++++++++++++++++++++++++++++
 .github/workflows/docs.yml             |  8 -----
 bindings/haskell/opendal-hs.cabal      |  9 ++++--
 3 files changed, 61 insertions(+), 11 deletions(-)

diff --git a/.github/workflows/bindings_haskell.yml 
b/.github/workflows/bindings_haskell.yml
index c483b990b..4ac540b8b 100644
--- a/.github/workflows/bindings_haskell.yml
+++ b/.github/workflows/bindings_haskell.yml
@@ -70,3 +70,58 @@ jobs:
           path: |
             ~/.cabal/store
             bindings/haskell/dist-newstyle
+
+  package:
+    runs-on: ubuntu-latest
+    if: "startsWith(github.ref, 'refs/tags/')"
+    steps:
+      - uses: actions/checkout@v3
+      - name: Setup Haskell toolchain (ghc-9.2.8)
+        run: |
+          curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | 
sh
+          ghcup install ghc 9.2.8 --set
+          ghcup install cabal --set
+          cabal update
+      - name: Setup Rust toolchain
+        uses: ./.github/actions/setup
+      - name: Restore haskell cache
+        uses: actions/cache/restore@v3
+        with:
+          key: ${{ runner.os }}-haskell-${{ hashFiles('**/*.cabal', 
'**/Setup.hs') }}
+          path: |
+            ~/.cabal/store
+            bindings/haskell/dist-newstyle
+          restore-keys: ${{ runner.os }}-haskell-
+      - name: Package
+        working-directory: "bindings/haskell"
+        run: |
+          cargo package --target-dir target
+          cd target/package
+          tar xf opendal-hs-*.crate --strip-components=1
+          cabal sdist
+      - name: Upload artifact
+        uses: actions/upload-artifact@v3
+        with:
+          name: bindings-haskell-sdist
+          path: bindings/haskell/target/package/dist-newstyle/sdist/*.tar.gz
+
+  release:
+    name: Release
+    runs-on: ubuntu-latest
+    if: "startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'rc')"
+    needs: [package]
+    steps:
+      - uses: actions/download-artifact@v3
+        with:
+          name: bindings-haskell-sdist
+      - name: Load secret
+        id: op-load-secret
+        uses: 1password/load-secrets-action@v1
+        with:
+          export-env: true
+        env:
+          OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
+          OPENDAL_HACKAGE_TOKEN: op://services/hackage/token
+      - name: Publish to Hackage
+        run: |
+          cabal upload -t $OPENDAL_HACKAGE_TOKEN --publish 
bindings/haskell/target/package/dist-newstyle/sdist/*.tar.gz
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 1821f870c..25f2ea8f6 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -210,14 +210,6 @@ jobs:
         run: |
           cabal haddock --haddock-html --haddock-quickjump 
--haddock-hyperlink-source
           find dist-newstyle -path '**/build/**/doc' -exec cp -r 
{}/html/opendal-hs/ doc \;
-        
-      - name: Save haskell cache
-        uses: actions/cache/save@v3
-        with:
-          key: ${{ runner.os }}-haskell-${{ hashFiles('**/*.cabal', 
'**/Setup.hs') }}
-          path: |
-            ~/.cabal/store
-            bindings/haskell/dist-newstyle
 
       - name: Upload docs
         uses: actions/upload-artifact@v3
diff --git a/bindings/haskell/opendal-hs.cabal 
b/bindings/haskell/opendal-hs.cabal
index e611ad287..12527beb4 100644
--- a/bindings/haskell/opendal-hs.cabal
+++ b/bindings/haskell/opendal-hs.cabal
@@ -1,4 +1,4 @@
-cabal-version:      2.2
+cabal-version:      3.0
 -- Licensed to the Apache Software Foundation (ASF) under one
 -- or more contributor license agreements.  See the NOTICE file
 -- distributed with this work for additional information
@@ -22,14 +22,17 @@ license:            Apache-2.0
 synopsis:           OpenDAL Haskell Binding
 description:
     OpenDAL Haskell Binding. Open Data Access Layer: Access data freely, 
painlessly, and efficiently
+author:             OpenDAL Contributors
+maintainer:         [email protected]
 category:           Storage, Binding
 tested-with:        GHC ==9.2.7
+extra-doc-files:    README.md, CONTRIBUTING.md
+extra-source-files: src/*.rs, Cargo.toml
+
 build-type:         Custom
 custom-setup
     setup-depends:  Cabal, base, directory, process
 
-extra-source-files: src/*.rs, Cargo.toml, build.rs
-
 source-repository head
     type:     git
     location: https://github.com/apache/incubator-opendal

Reply via email to