feat: @serverless-devs/secret #80
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- '**/**.md' | |
jobs: | |
build-and-test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
node-version: [18.x, 20.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Install dependencies | |
run: npm run install:all | |
- name: Build | |
run: npm run build | |
- name: Install s | |
run: npm install -g @serverless-devs/s | |
- name: s config | |
run: s config add --AccessKeyID 123 --AccessKeySecret 123 --AccountID 123 --SecurityToken 123 -a default | |
- name: export env | |
if: matrix.os != 'windows-latest' | |
run: | | |
export AccountID=123 | |
export AccessKeyID=123 | |
export AccessKeySecret=123 | |
export region=cn-chengdu | |
export desc=this_is_a_desc | |
- name: export env windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
$env:AccountID=123 | |
$env:AccessKeyID=123 | |
$env:AccessKeySecret=123 | |
$env:region="cn-chengdu" | |
$env:desc="this_is_a_desc" | |
- name: Run tests | |
run: npm run ci | |
# publish-beta: | |
# runs-on: ubuntu-latest | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# package: | |
# - component-interface | |
# - component-manager | |
# - credential | |
# - diff | |
# - downloads | |
# - engine | |
# - ignore-walk | |
# - load-application | |
# - load-component | |
# - logger | |
# - orm | |
# - parse-spec | |
# - progress-bar | |
# - registry | |
# - utils | |
# - zip | |
# steps: | |
# - uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 2 | |
# - name: Set up Node.js | |
# uses: actions/setup-node@v2 | |
# with: | |
# node-version: '18' | |
# registry-url: https://registry.npmjs.org/ | |
# - name: Install pnpm | |
# run: npm install -g pnpm | |
# - name: Install dependencies | |
# run: npm run install:all | |
# - name: Build packages | |
# run: npm run build | |
# - name: Publish package | |
# run: | | |
# PACKAGE_DIR=packages/${{ matrix.package }} | |
# PACKAGE_JSON="${PACKAGE_DIR}/package.json" | |
# # 检查 package.json 是否被修改 | |
# if git diff HEAD^ HEAD --name-only | grep -q "${PACKAGE_JSON}"; then | |
# echo "Publishing ${{ matrix.package }}..." | |
# cd $PACKAGE_DIR | |
# pnpm publish --tag=beta | |
# else | |
# echo "No changes in ${{ matrix.package }}/package.json" | |
# fi | |
# env: | |
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |