You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "yuchanns (via GitHub)" <gi...@apache.org> on 2024/07/17 08:34:14 UTC
[PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
yuchanns opened a new pull request, #2:
URL: https://github.com/apache/opendal-go-services/pull/2
This PR will automatically build and upload the artifacts to the respective `opendal-${VERSION}` branch.
Trigger by `workflow_dispatch` with an argument of the tag of opendal.
- Please modify it to a triggering way suitable for the opendal automated release process.
- I didn't enable all of the services as they may have failed for some of them. Therefore I need help from @Xuanwo to set up the build environment for them.
- tag a version (manually / automatically) on the respective branch, and then you release a new go-lib version.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #2:
URL: https://github.com/apache/opendal-go-services/pull/2#discussion_r1682894124
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
Review Comment:
How about making it's name more clear like `opendal_core_version` and `opendal_go_version`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns commented on code in PR #2:
URL: https://github.com/apache/opendal-go-services/pull/2#discussion_r1682866716
##########
generate/templates/service.go.tpl:
##########
@@ -0,0 +1,104 @@
+// 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
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package {{.pkg}}
+
+import (
+ "bytes"
+ "fmt"
+ "io"
+ "os"
+ "sync"
+
+ "github.com/klauspost/compress/zstd"
+)
+
+var Scheme = scheme{once: &sync.Once{}}
+
+type scheme struct {
+ once *sync.Once
+}
+
+func (scheme) Name() string {
+ return "{{.pkg}}"
+}
+
+func (s scheme) Path() string {
+ return path
+}
+
+func (s scheme) LoadOnce() error {
+ var err error
+ s.once.Do(func() {
+ err = load()
+ if err != nil {
+ err = fmt.Errorf("opendal/services/aliyun_drive: %s", err)
Review Comment:
Oops!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #2:
URL: https://github.com/apache/opendal-go-services/pull/2
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns commented on code in PR #2:
URL: https://github.com/apache/opendal-go-services/pull/2#discussion_r1682870485
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
Review Comment:
`binding_tag` is added. And it is optional.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns commented on code in PR #2:
URL: https://github.com/apache/opendal-go-services/pull/2#discussion_r1682897863
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
Review Comment:
bravo!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns commented on code in PR #2:
URL: https://github.com/apache/opendal-go-services/pull/2#discussion_r1682509626
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
Review Comment:
LGTM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns commented on code in PR #2:
URL: https://github.com/apache/opendal-go-services/pull/2#discussion_r1682870485
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
Review Comment:
`binding_tag` is added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns commented on code in PR #2:
URL: https://github.com/apache/opendal-go-services/pull/2#discussion_r1682507258
##########
generate/templates/embed_{{.os}}_{{.arch}}.go.tpl:
##########
@@ -0,0 +1,25 @@
+// 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
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package {{.pkg}}
+
+import _ "embed"
+
+//go:embed libopendal_c.so.{{.os}}.{{.arch}}.zst
Review Comment:
make sense
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns commented on code in PR #2:
URL: https://github.com/apache/opendal-go-services/pull/2#discussion_r1682866156
##########
generate/templates/service.go.tpl:
##########
@@ -0,0 +1,113 @@
+// 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
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package {{.pkg}}
+
+import (
+ "bytes"
+ "fmt"
+ "io"
+ "os"
+ "sync"
+
+ "github.com/klauspost/compress/zstd"
+)
+
+var Scheme = scheme{once: &sync.Once{}}
+
+type scheme struct {
+ once *sync.Once
+}
+
+func (scheme) Name() string {
+ return "{{.pkg}}"
+}
+
+func (s scheme) Path() string {
+ return path
+}
+
+func (s scheme) LoadOnce() error {
+ var err error
+ s.once.Do(func() {
+ err = load()
+ })
+ return err
+}
+
+var path string
+
+func load() error {
+ var (
+ err error
+ data []byte
+ )
+ var loop = true
+ for loop {
+ loop = false
Review Comment:
removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns commented on code in PR #2:
URL: https://github.com/apache/opendal-go-services/pull/2#discussion_r1682507748
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
+ description: "version of Apache OpenDAL to build"
+ required: true
+ type: string
+jobs:
+ matrix:
+ runs-on: ubuntu-latest
+ outputs:
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
+ steps:
+ - id: set-matrix
+ name: Setup Matrix
+ run: |
+ cat <<EOF > ./matrix.yaml
+ os: ["ubuntu-latest"]
+ target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
+ service:
+ - "aliyun-drive"
+ # - "alluxio"
+ # - "atomicserver"
+ # - "azblob"
+ # - "azdls"
+ # - "azfile"
+ # - "b2"
+ # - "cacache"
+ # - "chainsafe"
+ # - "cloudflare-kv"
+ # - "compfs"
+ # - "cos"
+ # - "d1"
+ # - "dashmap"
+ # - "dbfs"
+ # - "dropbox"
+ # - "etcd"
+ # - "foundationdb"
+ - "fs"
+ # - "ftp"
+ # - "gcs"
+ - "gdrive"
+ # - "ghac"
+ # - "github"
+ # - "gridfs"
+ # - "hdfs-native"
+ # - "http"
+ # - "huggingface"
+ # - "icloud"
+ # - "ipmfs"
+ # - "koofr"
+ # - "libsql"
+ # - "memcached"
+ - "memory"
+ # - "mini-moka"
+ # - "moka"
+ # - "mongodb"
+ # - "mysql"
+ # - "obs"
+ # - "onedrive"
+ # - "oss"
+ # - "pcloud"
+ # - "persy"
+ # - "postgresql"
+ # - "redb"
+ # - "redis"
+ # - "redis-native-tls"
+ # - "rocksdb"
+ - "s3"
+ # - "seafile"
+ # - "sftp"
+ # - "sled"
+ # - "sqlite"
+ # - "supabase"
+ # - "surrealdb"
+ # - "swift"
+ # - "tikv"
+ # - "upyun"
+ # - "vercel-artifacts"
+ # - "vercel-blob"
+ # - "webdav"
+ # - "webhdfs"
+ # - "yandex-disk"
+ EOF
+ MATRIX=$(yq -o=json -I=0 "." ./matrix.yaml | sed 's/ //g')
+ echo "Matrix:"
+ echo "$MATRIX" | jq .
+ echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
+ build:
+ needs: [ matrix ]
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ repository: "apache/opendal"
+ ref: ${{ inputs.opendal_tag }}
+ - name: Setup Rust toolchain
+ uses: ./.github/actions/setup
+ - name: Setup Target
+ env:
+ TARGET: ${{ matrix.target }}
+ run: rustup target add $TARGET
+ - name: Setup AArch64 Tool
+ if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
+ working-directory: bindings/c
+ run: |
+ sudo apt update
+ sudo apt install gcc-aarch64-linux-gnu -y
+ echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
Review Comment:
got it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #2:
URL: https://github.com/apache/opendal-go-services/pull/2#discussion_r1680955509
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
Review Comment:
We need to two input, the tag of opendal to checkout and tag for go binding to release.
We can add support for `repository_dispatch` here, allowing us to trigger it by creating a tag in the opendal repository. This feature can be implemented later.
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
+ description: "version of Apache OpenDAL to build"
+ required: true
+ type: string
+jobs:
+ matrix:
+ runs-on: ubuntu-latest
+ outputs:
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
+ steps:
+ - id: set-matrix
+ name: Setup Matrix
+ run: |
+ cat <<EOF > ./matrix.yaml
+ os: ["ubuntu-latest"]
+ target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
+ service:
+ - "aliyun-drive"
+ # - "alluxio"
+ # - "atomicserver"
+ # - "azblob"
+ # - "azdls"
+ # - "azfile"
+ # - "b2"
+ # - "cacache"
+ # - "chainsafe"
+ # - "cloudflare-kv"
+ # - "compfs"
+ # - "cos"
+ # - "d1"
+ # - "dashmap"
+ # - "dbfs"
+ # - "dropbox"
+ # - "etcd"
+ # - "foundationdb"
+ - "fs"
+ # - "ftp"
+ # - "gcs"
+ - "gdrive"
+ # - "ghac"
+ # - "github"
+ # - "gridfs"
+ # - "hdfs-native"
+ # - "http"
+ # - "huggingface"
+ # - "icloud"
+ # - "ipmfs"
+ # - "koofr"
+ # - "libsql"
+ # - "memcached"
+ - "memory"
+ # - "mini-moka"
+ # - "moka"
+ # - "mongodb"
+ # - "mysql"
+ # - "obs"
+ # - "onedrive"
+ # - "oss"
+ # - "pcloud"
+ # - "persy"
+ # - "postgresql"
+ # - "redb"
+ # - "redis"
+ # - "redis-native-tls"
+ # - "rocksdb"
+ - "s3"
+ # - "seafile"
+ # - "sftp"
+ # - "sled"
+ # - "sqlite"
+ # - "supabase"
+ # - "surrealdb"
+ # - "swift"
+ # - "tikv"
+ # - "upyun"
+ # - "vercel-artifacts"
+ # - "vercel-blob"
+ # - "webdav"
+ # - "webhdfs"
+ # - "yandex-disk"
+ EOF
+ MATRIX=$(yq -o=json -I=0 "." ./matrix.yaml | sed 's/ //g')
+ echo "Matrix:"
+ echo "$MATRIX" | jq .
+ echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
+ build:
+ needs: [ matrix ]
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ repository: "apache/opendal"
+ ref: ${{ inputs.opendal_tag }}
+ - name: Setup Rust toolchain
+ uses: ./.github/actions/setup
+ - name: Setup Target
+ env:
+ TARGET: ${{ matrix.target }}
+ run: rustup target add $TARGET
+ - name: Setup AArch64 Tool
+ if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
+ working-directory: bindings/c
+ run: |
+ sudo apt update
+ sudo apt install gcc-aarch64-linux-gnu -y
+ echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
+ mkdir .cargo
+ cat << EOF > .cargo/config.toml
+ [target.aarch64-unknown-linux-gnu]
+ linker = "aarch64-linux-gnu-gcc"
+ EOF
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.10"
+ - name: Setup Service
+ working-directory: bindings/c
+ env:
+ OPENDAL_FEATURES: "layers-blocking,services-${{ matrix.service }}"
+ run: |
+ python -m pip install toml
+ cat << EOF > ./setup_feature.py
Review Comment:
Better to maintain this file in `.github/scripts` and then refer it.
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
+ description: "version of Apache OpenDAL to build"
+ required: true
+ type: string
+jobs:
+ matrix:
+ runs-on: ubuntu-latest
+ outputs:
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
+ steps:
+ - id: set-matrix
+ name: Setup Matrix
+ run: |
+ cat <<EOF > ./matrix.yaml
Review Comment:
Better to maintain this file in `.github/scripts`.
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
+ description: "version of Apache OpenDAL to build"
+ required: true
+ type: string
+jobs:
+ matrix:
+ runs-on: ubuntu-latest
+ outputs:
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
+ steps:
+ - id: set-matrix
+ name: Setup Matrix
+ run: |
+ cat <<EOF > ./matrix.yaml
+ os: ["ubuntu-latest"]
+ target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
+ service:
+ - "aliyun-drive"
+ # - "alluxio"
+ # - "atomicserver"
+ # - "azblob"
+ # - "azdls"
+ # - "azfile"
+ # - "b2"
+ # - "cacache"
+ # - "chainsafe"
+ # - "cloudflare-kv"
+ # - "compfs"
+ # - "cos"
+ # - "d1"
+ # - "dashmap"
+ # - "dbfs"
+ # - "dropbox"
+ # - "etcd"
+ # - "foundationdb"
+ - "fs"
+ # - "ftp"
+ # - "gcs"
+ - "gdrive"
+ # - "ghac"
+ # - "github"
+ # - "gridfs"
+ # - "hdfs-native"
+ # - "http"
+ # - "huggingface"
+ # - "icloud"
+ # - "ipmfs"
+ # - "koofr"
+ # - "libsql"
+ # - "memcached"
+ - "memory"
+ # - "mini-moka"
+ # - "moka"
+ # - "mongodb"
+ # - "mysql"
+ # - "obs"
+ # - "onedrive"
+ # - "oss"
+ # - "pcloud"
+ # - "persy"
+ # - "postgresql"
+ # - "redb"
+ # - "redis"
+ # - "redis-native-tls"
+ # - "rocksdb"
+ - "s3"
+ # - "seafile"
+ # - "sftp"
+ # - "sled"
+ # - "sqlite"
+ # - "supabase"
+ # - "surrealdb"
+ # - "swift"
+ # - "tikv"
+ # - "upyun"
+ # - "vercel-artifacts"
+ # - "vercel-blob"
+ # - "webdav"
+ # - "webhdfs"
+ # - "yandex-disk"
+ EOF
+ MATRIX=$(yq -o=json -I=0 "." ./matrix.yaml | sed 's/ //g')
+ echo "Matrix:"
+ echo "$MATRIX" | jq .
+ echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
+ build:
+ needs: [ matrix ]
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ repository: "apache/opendal"
+ ref: ${{ inputs.opendal_tag }}
+ - name: Setup Rust toolchain
+ uses: ./.github/actions/setup
+ - name: Setup Target
+ env:
+ TARGET: ${{ matrix.target }}
+ run: rustup target add $TARGET
+ - name: Setup AArch64 Tool
+ if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
+ working-directory: bindings/c
+ run: |
+ sudo apt update
+ sudo apt install gcc-aarch64-linux-gnu -y
+ echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
+ mkdir .cargo
+ cat << EOF > .cargo/config.toml
+ [target.aarch64-unknown-linux-gnu]
+ linker = "aarch64-linux-gnu-gcc"
+ EOF
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.10"
+ - name: Setup Service
+ working-directory: bindings/c
+ env:
+ OPENDAL_FEATURES: "layers-blocking,services-${{ matrix.service }}"
+ run: |
+ python -m pip install toml
+ cat << EOF > ./setup_feature.py
+ import toml
+ import os
+
+ with open('Cargo.toml', 'r') as f:
+ cargo_toml = toml.load(f)
+
+ enabled_features = os.environ.get('OPENDAL_FEATURES', '').split(',')
+
+ opendal_features = []
+ for feature in enabled_features:
+ if feature.strip():
+ opendal_features.append(feature.strip())
+
+ cargo_toml['dependencies']['opendal']['features'] = opendal_features
+
+ with open('Cargo.toml', 'w') as f:
+ toml.dump(cargo_toml, f)
+ EOF
+ python ./setup_feature.py
+ - name: Build ${{ matrix.service }} ${{ matrix.target }}
+ working-directory: bindings/c
+ env:
+ SERVICE: ${{ matrix.service }}
+ TARGET: ${{ matrix.target }}
+ run: |
+ CC="${{ env.CC }}" cargo build --target $TARGET --release
+ sudo apt install zstd
+ zstd -22 ./target/$TARGET/release/libopendal_c.so -o ./libopendal_c.so.$TARGET.zst
+ - uses: actions/upload-artifact@v4
+ with:
+ name: "libopendal_c_${{ inputs.opendal_tag }}_${{ matrix.service }}_${{ matrix.target }}"
+ if-no-files-found: "error"
+ path: "bindings/c/libopendal_c.so.${{ matrix.target }}.zst"
+ overwrite: "true"
+ generate:
+ needs: [ matrix, build ]
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-go@v5
+ - uses: actions/download-artifact@v4
+ - name: Generate Template
+ env:
+ MATRIX: ${{ needs.matrix.outputs.matrix }}
+ VERSION: ${{ inputs.opendal_tag }}
+ working-directory: generate
+ run: |
+ go run generate.go
+ - name: Auto Commit
+ env:
+ VERSION: ${{ inputs.opendal_tag }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ git config --global user.name "Github Actions"
+ git config --global user.email "actions@github.com"
+ git branch opendal-$VERSION
+ git checkout opendal-$VERSION
+ git add -A
Review Comment:
Can we just push to `main` and create tag over it? I feel like it's easier to checkout and use.
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
+ description: "version of Apache OpenDAL to build"
+ required: true
+ type: string
+jobs:
+ matrix:
+ runs-on: ubuntu-latest
+ outputs:
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
+ steps:
+ - id: set-matrix
+ name: Setup Matrix
+ run: |
+ cat <<EOF > ./matrix.yaml
+ os: ["ubuntu-latest"]
+ target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
+ service:
+ - "aliyun-drive"
+ # - "alluxio"
+ # - "atomicserver"
+ # - "azblob"
+ # - "azdls"
+ # - "azfile"
+ # - "b2"
+ # - "cacache"
+ # - "chainsafe"
+ # - "cloudflare-kv"
+ # - "compfs"
+ # - "cos"
+ # - "d1"
+ # - "dashmap"
+ # - "dbfs"
+ # - "dropbox"
+ # - "etcd"
+ # - "foundationdb"
+ - "fs"
+ # - "ftp"
+ # - "gcs"
+ - "gdrive"
+ # - "ghac"
+ # - "github"
+ # - "gridfs"
+ # - "hdfs-native"
+ # - "http"
+ # - "huggingface"
+ # - "icloud"
+ # - "ipmfs"
+ # - "koofr"
+ # - "libsql"
+ # - "memcached"
+ - "memory"
+ # - "mini-moka"
+ # - "moka"
+ # - "mongodb"
+ # - "mysql"
+ # - "obs"
+ # - "onedrive"
+ # - "oss"
+ # - "pcloud"
+ # - "persy"
+ # - "postgresql"
+ # - "redb"
+ # - "redis"
+ # - "redis-native-tls"
+ # - "rocksdb"
+ - "s3"
+ # - "seafile"
+ # - "sftp"
+ # - "sled"
+ # - "sqlite"
+ # - "supabase"
+ # - "surrealdb"
+ # - "swift"
+ # - "tikv"
+ # - "upyun"
+ # - "vercel-artifacts"
+ # - "vercel-blob"
+ # - "webdav"
+ # - "webhdfs"
+ # - "yandex-disk"
+ EOF
+ MATRIX=$(yq -o=json -I=0 "." ./matrix.yaml | sed 's/ //g')
+ echo "Matrix:"
+ echo "$MATRIX" | jq .
+ echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
+ build:
+ needs: [ matrix ]
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ repository: "apache/opendal"
+ ref: ${{ inputs.opendal_tag }}
+ - name: Setup Rust toolchain
+ uses: ./.github/actions/setup
+ - name: Setup Target
+ env:
+ TARGET: ${{ matrix.target }}
+ run: rustup target add $TARGET
+ - name: Setup AArch64 Tool
+ if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
+ working-directory: bindings/c
+ run: |
+ sudo apt update
+ sudo apt install gcc-aarch64-linux-gnu -y
+ echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
+ mkdir .cargo
+ cat << EOF > .cargo/config.toml
+ [target.aarch64-unknown-linux-gnu]
+ linker = "aarch64-linux-gnu-gcc"
+ EOF
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.10"
+ - name: Setup Service
+ working-directory: bindings/c
+ env:
+ OPENDAL_FEATURES: "layers-blocking,services-${{ matrix.service }}"
+ run: |
+ python -m pip install toml
+ cat << EOF > ./setup_feature.py
+ import toml
+ import os
+
+ with open('Cargo.toml', 'r') as f:
+ cargo_toml = toml.load(f)
+
+ enabled_features = os.environ.get('OPENDAL_FEATURES', '').split(',')
+
+ opendal_features = []
+ for feature in enabled_features:
+ if feature.strip():
+ opendal_features.append(feature.strip())
+
+ cargo_toml['dependencies']['opendal']['features'] = opendal_features
+
+ with open('Cargo.toml', 'w') as f:
+ toml.dump(cargo_toml, f)
+ EOF
+ python ./setup_feature.py
+ - name: Build ${{ matrix.service }} ${{ matrix.target }}
+ working-directory: bindings/c
+ env:
+ SERVICE: ${{ matrix.service }}
+ TARGET: ${{ matrix.target }}
+ run: |
+ CC="${{ env.CC }}" cargo build --target $TARGET --release
+ sudo apt install zstd
+ zstd -22 ./target/$TARGET/release/libopendal_c.so -o ./libopendal_c.so.$TARGET.zst
Review Comment:
How about call this file `libopendal_c.$TARGET.so`?
##########
generate/templates/embed_{{.os}}_{{.arch}}.go.tpl:
##########
@@ -0,0 +1,25 @@
+// 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
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package {{.pkg}}
+
+import _ "embed"
+
+//go:embed libopendal_c.so.{{.os}}.{{.arch}}.zst
Review Comment:
I personally feel like file name should be `libopendal_c.{{.os}}.{{.arch}}.so.zst` to avoid confusing.
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
+ description: "version of Apache OpenDAL to build"
+ required: true
+ type: string
+jobs:
+ matrix:
+ runs-on: ubuntu-latest
+ outputs:
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
+ steps:
+ - id: set-matrix
+ name: Setup Matrix
+ run: |
+ cat <<EOF > ./matrix.yaml
+ os: ["ubuntu-latest"]
+ target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
+ service:
+ - "aliyun-drive"
+ # - "alluxio"
+ # - "atomicserver"
+ # - "azblob"
+ # - "azdls"
+ # - "azfile"
+ # - "b2"
+ # - "cacache"
+ # - "chainsafe"
+ # - "cloudflare-kv"
+ # - "compfs"
+ # - "cos"
+ # - "d1"
+ # - "dashmap"
+ # - "dbfs"
+ # - "dropbox"
+ # - "etcd"
+ # - "foundationdb"
+ - "fs"
+ # - "ftp"
+ # - "gcs"
+ - "gdrive"
+ # - "ghac"
+ # - "github"
+ # - "gridfs"
+ # - "hdfs-native"
+ # - "http"
+ # - "huggingface"
+ # - "icloud"
+ # - "ipmfs"
+ # - "koofr"
+ # - "libsql"
+ # - "memcached"
+ - "memory"
+ # - "mini-moka"
+ # - "moka"
+ # - "mongodb"
+ # - "mysql"
+ # - "obs"
+ # - "onedrive"
+ # - "oss"
+ # - "pcloud"
+ # - "persy"
+ # - "postgresql"
+ # - "redb"
+ # - "redis"
+ # - "redis-native-tls"
+ # - "rocksdb"
+ - "s3"
+ # - "seafile"
+ # - "sftp"
+ # - "sled"
+ # - "sqlite"
+ # - "supabase"
+ # - "surrealdb"
+ # - "swift"
+ # - "tikv"
+ # - "upyun"
+ # - "vercel-artifacts"
+ # - "vercel-blob"
+ # - "webdav"
+ # - "webhdfs"
+ # - "yandex-disk"
+ EOF
+ MATRIX=$(yq -o=json -I=0 "." ./matrix.yaml | sed 's/ //g')
+ echo "Matrix:"
+ echo "$MATRIX" | jq .
+ echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
+ build:
+ needs: [ matrix ]
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ repository: "apache/opendal"
+ ref: ${{ inputs.opendal_tag }}
+ - name: Setup Rust toolchain
+ uses: ./.github/actions/setup
+ - name: Setup Target
+ env:
+ TARGET: ${{ matrix.target }}
+ run: rustup target add $TARGET
+ - name: Setup AArch64 Tool
+ if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
+ working-directory: bindings/c
+ run: |
+ sudo apt update
+ sudo apt install gcc-aarch64-linux-gnu -y
+ echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
Review Comment:
Better to use `env` of step instead.
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
+ description: "version of Apache OpenDAL to build"
+ required: true
+ type: string
+jobs:
+ matrix:
+ runs-on: ubuntu-latest
+ outputs:
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
+ steps:
+ - id: set-matrix
+ name: Setup Matrix
+ run: |
+ cat <<EOF > ./matrix.yaml
+ os: ["ubuntu-latest"]
+ target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
+ service:
+ - "aliyun-drive"
+ # - "alluxio"
+ # - "atomicserver"
+ # - "azblob"
+ # - "azdls"
+ # - "azfile"
+ # - "b2"
+ # - "cacache"
+ # - "chainsafe"
+ # - "cloudflare-kv"
+ # - "compfs"
+ # - "cos"
+ # - "d1"
+ # - "dashmap"
+ # - "dbfs"
+ # - "dropbox"
+ # - "etcd"
+ # - "foundationdb"
+ - "fs"
+ # - "ftp"
+ # - "gcs"
+ - "gdrive"
+ # - "ghac"
+ # - "github"
+ # - "gridfs"
+ # - "hdfs-native"
+ # - "http"
+ # - "huggingface"
+ # - "icloud"
+ # - "ipmfs"
+ # - "koofr"
+ # - "libsql"
+ # - "memcached"
+ - "memory"
+ # - "mini-moka"
+ # - "moka"
+ # - "mongodb"
+ # - "mysql"
+ # - "obs"
+ # - "onedrive"
+ # - "oss"
+ # - "pcloud"
+ # - "persy"
+ # - "postgresql"
+ # - "redb"
+ # - "redis"
+ # - "redis-native-tls"
+ # - "rocksdb"
+ - "s3"
+ # - "seafile"
+ # - "sftp"
+ # - "sled"
+ # - "sqlite"
+ # - "supabase"
+ # - "surrealdb"
+ # - "swift"
+ # - "tikv"
+ # - "upyun"
+ # - "vercel-artifacts"
+ # - "vercel-blob"
+ # - "webdav"
+ # - "webhdfs"
+ # - "yandex-disk"
+ EOF
+ MATRIX=$(yq -o=json -I=0 "." ./matrix.yaml | sed 's/ //g')
+ echo "Matrix:"
+ echo "$MATRIX" | jq .
+ echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
+ build:
+ needs: [ matrix ]
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ repository: "apache/opendal"
+ ref: ${{ inputs.opendal_tag }}
+ - name: Setup Rust toolchain
+ uses: ./.github/actions/setup
+ - name: Setup Target
+ env:
+ TARGET: ${{ matrix.target }}
+ run: rustup target add $TARGET
+ - name: Setup AArch64 Tool
+ if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
+ working-directory: bindings/c
+ run: |
+ sudo apt update
+ sudo apt install gcc-aarch64-linux-gnu -y
+ echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
+ mkdir .cargo
+ cat << EOF > .cargo/config.toml
+ [target.aarch64-unknown-linux-gnu]
+ linker = "aarch64-linux-gnu-gcc"
+ EOF
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.10"
+ - name: Setup Service
+ working-directory: bindings/c
+ env:
+ OPENDAL_FEATURES: "layers-blocking,services-${{ matrix.service }}"
+ run: |
+ python -m pip install toml
+ cat << EOF > ./setup_feature.py
+ import toml
+ import os
+
+ with open('Cargo.toml', 'r') as f:
+ cargo_toml = toml.load(f)
+
+ enabled_features = os.environ.get('OPENDAL_FEATURES', '').split(',')
+
+ opendal_features = []
+ for feature in enabled_features:
+ if feature.strip():
+ opendal_features.append(feature.strip())
+
+ cargo_toml['dependencies']['opendal']['features'] = opendal_features
+
+ with open('Cargo.toml', 'w') as f:
+ toml.dump(cargo_toml, f)
+ EOF
+ python ./setup_feature.py
+ - name: Build ${{ matrix.service }} ${{ matrix.target }}
+ working-directory: bindings/c
+ env:
+ SERVICE: ${{ matrix.service }}
+ TARGET: ${{ matrix.target }}
+ run: |
+ CC="${{ env.CC }}" cargo build --target $TARGET --release
+ sudo apt install zstd
+ zstd -22 ./target/$TARGET/release/libopendal_c.so -o ./libopendal_c.so.$TARGET.zst
+ - uses: actions/upload-artifact@v4
+ with:
+ name: "libopendal_c_${{ inputs.opendal_tag }}_${{ matrix.service }}_${{ matrix.target }}"
+ if-no-files-found: "error"
+ path: "bindings/c/libopendal_c.so.${{ matrix.target }}.zst"
Review Comment:
The same.
##########
generate/templates/service.go.tpl:
##########
@@ -0,0 +1,113 @@
+// 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
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package {{.pkg}}
+
+import (
+ "bytes"
+ "fmt"
+ "io"
+ "os"
+ "sync"
+
+ "github.com/klauspost/compress/zstd"
+)
+
+var Scheme = scheme{once: &sync.Once{}}
+
+type scheme struct {
+ once *sync.Once
+}
+
+func (scheme) Name() string {
+ return "{{.pkg}}"
+}
+
+func (s scheme) Path() string {
+ return path
+}
+
+func (s scheme) LoadOnce() error {
+ var err error
+ s.once.Do(func() {
+ err = load()
+ })
+ return err
+}
+
+var path string
+
+func load() error {
+ var (
+ err error
+ data []byte
+ )
+ var loop = true
+ for loop {
+ loop = false
Review Comment:
Why we need this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
Posted by "yuchanns (via GitHub)" <gi...@apache.org>.
yuchanns commented on code in PR #2:
URL: https://github.com/apache/opendal-go-services/pull/2#discussion_r1682509075
##########
.github/workflows/build_artifacts.yaml:
##########
@@ -0,0 +1,188 @@
+name: build_artifacts
+on:
+ workflow_dispatch:
+ inputs:
+ opendal_tag:
+ description: "version of Apache OpenDAL to build"
+ required: true
+ type: string
+jobs:
+ matrix:
+ runs-on: ubuntu-latest
+ outputs:
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
+ steps:
+ - id: set-matrix
+ name: Setup Matrix
+ run: |
+ cat <<EOF > ./matrix.yaml
+ os: ["ubuntu-latest"]
+ target: ["x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"]
+ service:
+ - "aliyun-drive"
+ # - "alluxio"
+ # - "atomicserver"
+ # - "azblob"
+ # - "azdls"
+ # - "azfile"
+ # - "b2"
+ # - "cacache"
+ # - "chainsafe"
+ # - "cloudflare-kv"
+ # - "compfs"
+ # - "cos"
+ # - "d1"
+ # - "dashmap"
+ # - "dbfs"
+ # - "dropbox"
+ # - "etcd"
+ # - "foundationdb"
+ - "fs"
+ # - "ftp"
+ # - "gcs"
+ - "gdrive"
+ # - "ghac"
+ # - "github"
+ # - "gridfs"
+ # - "hdfs-native"
+ # - "http"
+ # - "huggingface"
+ # - "icloud"
+ # - "ipmfs"
+ # - "koofr"
+ # - "libsql"
+ # - "memcached"
+ - "memory"
+ # - "mini-moka"
+ # - "moka"
+ # - "mongodb"
+ # - "mysql"
+ # - "obs"
+ # - "onedrive"
+ # - "oss"
+ # - "pcloud"
+ # - "persy"
+ # - "postgresql"
+ # - "redb"
+ # - "redis"
+ # - "redis-native-tls"
+ # - "rocksdb"
+ - "s3"
+ # - "seafile"
+ # - "sftp"
+ # - "sled"
+ # - "sqlite"
+ # - "supabase"
+ # - "surrealdb"
+ # - "swift"
+ # - "tikv"
+ # - "upyun"
+ # - "vercel-artifacts"
+ # - "vercel-blob"
+ # - "webdav"
+ # - "webhdfs"
+ # - "yandex-disk"
+ EOF
+ MATRIX=$(yq -o=json -I=0 "." ./matrix.yaml | sed 's/ //g')
+ echo "Matrix:"
+ echo "$MATRIX" | jq .
+ echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
+ build:
+ needs: [ matrix ]
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ repository: "apache/opendal"
+ ref: ${{ inputs.opendal_tag }}
+ - name: Setup Rust toolchain
+ uses: ./.github/actions/setup
+ - name: Setup Target
+ env:
+ TARGET: ${{ matrix.target }}
+ run: rustup target add $TARGET
+ - name: Setup AArch64 Tool
+ if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
+ working-directory: bindings/c
+ run: |
+ sudo apt update
+ sudo apt install gcc-aarch64-linux-gnu -y
+ echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
+ mkdir .cargo
+ cat << EOF > .cargo/config.toml
+ [target.aarch64-unknown-linux-gnu]
+ linker = "aarch64-linux-gnu-gcc"
+ EOF
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.10"
+ - name: Setup Service
+ working-directory: bindings/c
+ env:
+ OPENDAL_FEATURES: "layers-blocking,services-${{ matrix.service }}"
+ run: |
+ python -m pip install toml
+ cat << EOF > ./setup_feature.py
+ import toml
+ import os
+
+ with open('Cargo.toml', 'r') as f:
+ cargo_toml = toml.load(f)
+
+ enabled_features = os.environ.get('OPENDAL_FEATURES', '').split(',')
+
+ opendal_features = []
+ for feature in enabled_features:
+ if feature.strip():
+ opendal_features.append(feature.strip())
+
+ cargo_toml['dependencies']['opendal']['features'] = opendal_features
+
+ with open('Cargo.toml', 'w') as f:
+ toml.dump(cargo_toml, f)
+ EOF
+ python ./setup_feature.py
+ - name: Build ${{ matrix.service }} ${{ matrix.target }}
+ working-directory: bindings/c
+ env:
+ SERVICE: ${{ matrix.service }}
+ TARGET: ${{ matrix.target }}
+ run: |
+ CC="${{ env.CC }}" cargo build --target $TARGET --release
+ sudo apt install zstd
+ zstd -22 ./target/$TARGET/release/libopendal_c.so -o ./libopendal_c.so.$TARGET.zst
+ - uses: actions/upload-artifact@v4
+ with:
+ name: "libopendal_c_${{ inputs.opendal_tag }}_${{ matrix.service }}_${{ matrix.target }}"
+ if-no-files-found: "error"
+ path: "bindings/c/libopendal_c.so.${{ matrix.target }}.zst"
+ overwrite: "true"
+ generate:
+ needs: [ matrix, build ]
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-go@v5
+ - uses: actions/download-artifact@v4
+ - name: Generate Template
+ env:
+ MATRIX: ${{ needs.matrix.outputs.matrix }}
+ VERSION: ${{ inputs.opendal_tag }}
+ working-directory: generate
+ run: |
+ go run generate.go
+ - name: Auto Commit
+ env:
+ VERSION: ${{ inputs.opendal_tag }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ git config --global user.name "Github Actions"
+ git config --global user.email "actions@github.com"
+ git branch opendal-$VERSION
+ git checkout opendal-$VERSION
+ git add -A
Review Comment:
Sure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(ci/workflows): add build_artifacts [opendal-go-services]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #2:
URL: https://github.com/apache/opendal-go-services/pull/2#discussion_r1682863826
##########
generate/templates/service.go.tpl:
##########
@@ -0,0 +1,104 @@
+// 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
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// generated by github.com/apache/opendal-go-services
+
+package {{.pkg}}
+
+import (
+ "bytes"
+ "fmt"
+ "io"
+ "os"
+ "sync"
+
+ "github.com/klauspost/compress/zstd"
+)
+
+var Scheme = scheme{once: &sync.Once{}}
+
+type scheme struct {
+ once *sync.Once
+}
+
+func (scheme) Name() string {
+ return "{{.pkg}}"
+}
+
+func (s scheme) Path() string {
+ return path
+}
+
+func (s scheme) LoadOnce() error {
+ var err error
+ s.once.Do(func() {
+ err = load()
+ if err != nil {
+ err = fmt.Errorf("opendal/services/aliyun_drive: %s", err)
Review Comment:
It seems wrong that `aliyun_drive` generated for all service?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org