2021-08-15 20:32:06 +01:00
|
|
|
name: authentik-web-api-publish
|
|
|
|
on:
|
|
|
|
push:
|
2022-06-03 18:40:09 +01:00
|
|
|
branches: [ main ]
|
2021-08-15 20:32:06 +01:00
|
|
|
paths:
|
|
|
|
- 'schema.yml'
|
2022-05-10 09:12:47 +01:00
|
|
|
workflow_dispatch:
|
2021-08-15 20:32:06 +01:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-02 08:56:53 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-08-15 20:32:06 +01:00
|
|
|
# Setup .npmrc file to publish to npm
|
2022-06-07 08:23:06 +01:00
|
|
|
- uses: actions/setup-node@v3.3.0
|
2021-08-15 20:32:06 +01:00
|
|
|
with:
|
2021-09-07 09:06:30 +01:00
|
|
|
node-version: '16'
|
2021-08-15 20:32:06 +01:00
|
|
|
registry-url: 'https://registry.npmjs.org'
|
2021-08-23 14:54:58 +01:00
|
|
|
- name: Generate API Client
|
2022-05-08 15:48:53 +01:00
|
|
|
run: make gen-client-web
|
2021-08-23 14:54:58 +01:00
|
|
|
- name: Publish package
|
2022-05-09 20:22:41 +01:00
|
|
|
working-directory: gen-ts-api/
|
2021-08-23 14:54:58 +01:00
|
|
|
run: |
|
2022-04-14 21:30:44 +01:00
|
|
|
npm ci
|
2021-08-15 20:32:06 +01:00
|
|
|
npm publish
|
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
2021-08-23 14:54:58 +01:00
|
|
|
- name: Upgrade /web
|
2022-05-09 20:22:41 +01:00
|
|
|
working-directory: web/
|
2021-08-23 14:54:58 +01:00
|
|
|
run: |
|
2022-05-10 09:19:15 +01:00
|
|
|
export VERSION=`node -e 'console.log(require("../gen-ts-api/package.json").version)'`
|
2021-08-23 14:57:56 +01:00
|
|
|
npm i @goauthentik/api@$VERSION
|
2021-08-23 14:54:58 +01:00
|
|
|
- name: Create Pull Request
|
2022-03-24 09:13:58 +00:00
|
|
|
uses: peter-evans/create-pull-request@v4
|
2021-11-23 18:15:31 +00:00
|
|
|
id: cpr
|
2021-08-23 14:54:58 +01:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: update-web-api-client
|
2021-08-23 15:48:24 +01:00
|
|
|
commit-message: "web: Update Web API Client version"
|
|
|
|
title: "web: Update Web API Client version"
|
2021-11-23 18:15:31 +00:00
|
|
|
body: "web: Update Web API Client version"
|
2021-08-23 14:54:58 +01:00
|
|
|
delete-branch: true
|
|
|
|
signoff: true
|