Skip to content

Commit

Permalink
refactor(.github): Update Node to v18, Python to v3.9, and optimize w…
Browse files Browse the repository at this point in the history
…orkflows
  • Loading branch information
HsiangNianian committed Nov 25, 2024
1 parent 3886c8d commit 6bb6ec9
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 71 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Setup Node
description: Setup Node

runs:
using: "composite"
using: composite
steps:
- uses: actions/setup-node@v2
with:
node-version: "16"
node-version: "18"

- id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
Expand Down
23 changes: 12 additions & 11 deletions .github/actions/setup-python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@ description: Setup Python
inputs:
python-version:
description: Python version
required: false
default: "3.10"
default: '3.9'

runs:
using: "composite"
using: composite
steps:
- name: Install poetry
run: pipx install poetry
shell: bash
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: uv.lock

- uses: actions/setup-python@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
architecture: "x64"
cache: "poetry"

- run: poetry install -E all
shell: bash
- name: Install the project
run: uv sync --all-extras --dev
shell: bash
14 changes: 5 additions & 9 deletions .github/workflows/build-api.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: BUILD API
name: Build API

on:
pull_request:
paths:
"docs/"
push:
paths:
"docs/"
# tags:
# - "v*"
workflow_dispatch:

jobs:
Expand All @@ -20,12 +20,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: pdm-project/setup-pdm@v4
name: Setup PDM
with:
python-version: 3.9
- name: Install dependencies
run: pdm install -dG docs
- name: Setup Python
uses: ./.github/actions/setup-python

- name: Remove API Doc
run: rm -rf docs/source/pages/api
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CHANGELOG
name: Generate Changelog

on:
push:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Publish Docker image

on:
push:
# branches:
# - main
# - master
branches:
- main
- master
tags:
- 'v*'
workflow_dispatch:
Expand Down
63 changes: 18 additions & 45 deletions .github/workflows/release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
tags:
- "v*"
paths:
- "packages/*"
# release:
# types: [published]
workflow_dispatch:
Expand All @@ -17,48 +19,19 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: pdm-project/setup-pdm@v4
name: Setup PDM
with:
python-version: 3.9
cache: true

- name: Install dependencies
run: pdm install

# - run: pdm publish
# shell: bash

- run: pdm publish
shell: bash
working-directory: ./packages/iamai-adapter-apscheduler

- run: pdm publish
shell: bash
working-directory: ./packages/iamai-adapter-kook

- run: pdm publish
shell: bash
working-directory: ./packages/iamai-adapter-cqhttp

- run: pdm publish
shell: bash
working-directory: ./packages/iamai-adapter-dingtalk

- run: pdm publish
shell: bash
working-directory: ./packages/iamai-adapter-bililive

- run: pdm publish
shell: bash
working-directory: ./packages/iamai-adapter-console

- run: pdm publish
shell: bash
working-directory: ./packages/iamai-adapter-red

- run: pdm publish
shell: bash
working-directory: ./packages/iamai-adapter-gensokyo


- name: Setup Python
uses: ./.github/actions/setup-python

- name: Build Packages
run: |
uv build --package iamai-adapter-cqhttp
uv build --package iamai-adapter-apscheduler
uv build --package iamai-adapter-bililive
uv build --package iamai-adapter-console
uv build --package iamai-adapter-dingtalk
uv build --package iamai-adapter-gensokyo
uv build --package iamai-adapter-kook
uv build --package iamai-adapter-red
- name: Publish Packages
run: uv publish

0 comments on commit 6bb6ec9

Please sign in to comment.