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

TEST #1065

Closed
Closed

TEST #1065

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
28 changes: 6 additions & 22 deletions .github/workflows/release-apiv2-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- "**/api_v2/**/*.py"
- "apiclient/typescript-fetch/package.json"
- ".github/workflows/release-apiv2-client.yml"
pull_request:
paths:
- ".github/workflows/release-apiv2-client.yml"

jobs:
release:
Expand Down Expand Up @@ -47,25 +50,6 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: generate client
run: npm run generate:client
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
working-directory: ./apiclient/typescript-fetch
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: "<!-- release-apiv2-client-notification -->"
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
<!-- release-apiv2-client-notification -->
:zap: :zap: :zap: Now the latest apiv2 client npm package is available at:
https://github.com/dmm-com/airone/pkgs/npm/airone-apiclient-typescript-fetch/versions
run: |
source virtualenv/bin/activate
poetry run npm run generate:client
50 changes: 50 additions & 0 deletions .github/workflows/release-apiv2-client_copy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release AirOne APIv2 client npm package to GitHub npm Registry

on:
push:
paths:
- ".github/workflows/release-apiv2-client_copy.yml"
pull_request:
paths:
- ".github/workflows/release-apiv2-client_copy.yml"

jobs:
release_copy:
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
1 change: 1 addition & 0 deletions tools/generate_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -u

OPENAPI_GENERATOR_VERSION=v6.6.0


# detect errors on spectacular
generr=$(poetry run python manage.py spectacular 2>&1 > /dev/null | grep ERROR);
if [ "$generr" != "" ]; then
Expand Down