Skip to content

Update release_api_v2_client configuration to aware of poetry #18

Update release_api_v2_client configuration to aware of poetry

Update release_api_v2_client configuration to aware of poetry #18

name: Release AirOne APIv2 client npm package to GitHub npm Registry
on:
# use pull_request_target with labeled(repo owner's operation) to prevent leaking secrets
# see also https://pankona.github.io/blog/2021/03/29/github-actions-pull-request-target/
pull_request_target:
types: [labeled]
paths:
- "**/api_v2/**/*.py"
- "apiclient/typescript-fetch/package.json"
- ".github/workflows/release-apiv2-client.yml"
pull_request:
paths:
- "tools/generate_client.sh"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
pull-requests: write
if: ${{ github.event.label.name == 'release-apiv2-client' }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: apt-get
run: |
sudo apt-get update
sudo apt-get install libldap2-dev libsasl2-dev libxmlsec1-dev libmysqlclient-dev pkg-config
- uses: actions/setup-python@v4
with:
python-version: "3.11.5"
- name: venv
run: |
python3 -m venv virtualenv
source virtualenv/bin/activate
pip install pip --upgrade
pip install poetry
poetry install --no-ansi
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
scope: "@dmm-com"
- name: install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: generate client
run: |
source virtualenv/bin/activate
poetry run npm run generate:client