Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Polish scripts and prepare for releasing #1553

Merged
merged 4 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 116 additions & 3 deletions .github/workflows/bindings_nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# limitations under the License.

name: Binding NodeJS CI

env:
DEBUG: napi:*
APP_NAME: opendal
MACOSX_DEPLOYMENT_TARGET: '10.13'

on:
Expand All @@ -31,8 +31,7 @@ on:
workflow_dispatch:

jobs:
test:
name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
linux:
strategy:
fail-fast: false
matrix:
Expand All @@ -59,5 +58,119 @@ jobs:
run: yarn install
- name: Build
run: yarn build
- uses: actions/upload-artifact@v3
with:
name: bindings-linux
path: bindings/nodejs/*.node
- name: Test bindings
run: yarn test

windows:
strategy:
fail-fast: false
matrix:
node:
- '18'
runs-on: windows-latest

# Notes: this defaults only apply on run tasks.
defaults:
run:
working-directory: "bindings/nodejs"

steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
cache-dependency-path: "bindings/nodejs/yarn.lock"
- name: Corepack
run: corepack enable
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- uses: actions/upload-artifact@v3
with:
name: bindings-windows
path: bindings/nodejs/*.node
- name: Test bindings
run: yarn test

macos:
strategy:
fail-fast: false
matrix:
node:
- '18'
runs-on: macos-latest

# Notes: this defaults only apply on run tasks.
defaults:
run:
working-directory: "bindings/nodejs"

steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
cache-dependency-path: "bindings/nodejs/yarn.lock"
- name: Corepack
run: corepack enable
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- uses: actions/upload-artifact@v3
with:
name: bindings-macos
path: bindings/nodejs/*.node
- name: Test bindings
run: yarn test

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [macos, linux, windows]

# Notes: this defaults only apply on run tasks.
defaults:
run:
working-directory: "bindings/nodejs"

steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
cache-dependency-path: "bindings/nodejs/yarn.lock"
- name: Corepack
run: corepack enable
- name: Install dependencies
run: yarn install

- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: bindings/nodejs/artifacts
- name: Move artifacts
run: yarn artifacts

- name: List packages
run: ls -R ./npm
shell: bash
- name: Publish
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --access public
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47 changes: 30 additions & 17 deletions .github/workflows/bindings_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
Expand All @@ -30,6 +32,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

permissions:
contents: read

jobs:
linux:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -57,22 +62,30 @@ jobs:
python -m pip install -r test_requirements.txt
python -m pytest

# Disable windows until we have test case migrated.
#
# windows:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# - uses: PyO3/maturin-action@v1
# with:
# working-directory: "bindings/python"
# command: build
# args: --release -o dist --find-interpreter
# - name: Upload wheels
# uses: actions/upload-artifact@v3
# with:
# name: wheels
# path: bindings/python/dist
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: PyO3/maturin-action@v1
with:
working-directory: "bindings/python"
command: build
args: --release -o dist --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: bindings/python/dist
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Run pytest
working-directory: "bindings/python"
run: |
set -e
python -m pip install opendal --find-links dist
python -m pip install -r test_requirements.txt
python -m pytest

macos:
runs-on: macos-latest
Expand Down Expand Up @@ -103,7 +116,7 @@ jobs:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [macos, linux]
needs: [macos, linux, windows]
steps:
- uses: actions/download-artifact@v3
with:
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,7 @@ jobs:
run: cargo build --all-features

unit:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout python env
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2022 Datafuse Labs
#
# Licensed 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.

name: Publish

on:
push:
tags:
- '*'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout python env
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Checkout java env
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: "11"
- name: Setup-hdfs env
uses: beyondstorage/setup-hdfs@master
with:
hdfs-version: "3.3.2"

- uses: Swatinem/rust-cache@v2

- name: Publish opendal
run: cargo publish --all-features
env:
LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }}

- name: Publish object_store_opendal
run: cargo publish
working-directory: "bindings/object_store"
env:
LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }}
3 changes: 0 additions & 3 deletions bindings/nodejs/npm/android-arm-eabi/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions bindings/nodejs/npm/android-arm-eabi/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions bindings/nodejs/npm/android-arm64/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions bindings/nodejs/npm/android-arm64/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions bindings/nodejs/npm/darwin-arm64/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions bindings/nodejs/npm/darwin-arm64/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions bindings/nodejs/npm/darwin-universal/README.md

This file was deleted.

15 changes: 0 additions & 15 deletions bindings/nodejs/npm/darwin-universal/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions bindings/nodejs/npm/darwin-x64/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion bindings/nodejs/npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opendal-darwin-x64",
"version": "0.0.0",
"version": "0.0.1",
"os": [
"darwin"
],
Expand Down
3 changes: 0 additions & 3 deletions bindings/nodejs/npm/freebsd-x64/README.md

This file was deleted.

Loading