2021-08-15 20:32:06 +01:00
|
|
|
name: authentik-web-api-publish
|
|
|
|
on:
|
|
|
|
push:
|
2023-04-21 11:54:23 +01:00
|
|
|
branches: [main]
|
2021-08-15 20:32:06 +01:00
|
|
|
paths:
|
2023-04-21 11:54:23 +01:00
|
|
|
- "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:
|
2023-05-31 13:23:04 +01:00
|
|
|
- id: generate_token
|
|
|
|
uses: tibdex/github-app-token@v1
|
|
|
|
with:
|
|
|
|
app_id: ${{ secrets.GH_APP_ID }}
|
|
|
|
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
|
2022-03-02 08:56:53 +00:00
|
|
|
- uses: actions/checkout@v3
|
2023-01-11 16:20:28 +00:00
|
|
|
with:
|
2023-05-31 13:23:04 +01:00
|
|
|
token: ${{ steps.generate_token.outputs.token }}
|
2023-01-06 08:49:09 +00:00
|
|
|
- uses: actions/setup-node@v3.6.0
|
2021-08-15 20:32:06 +01:00
|
|
|
with:
|
2023-04-21 11:54:23 +01:00
|
|
|
node-version: "20"
|
|
|
|
registry-url: "https://registry.npmjs.org"
|
2021-08-23 14:54:58 +01:00
|
|
|
- name: Generate API Client
|
2022-09-11 22:01:26 +01:00
|
|
|
run: make gen-client-ts
|
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
|
2023-04-05 10:31:25 +01:00
|
|
|
- uses: peter-evans/create-pull-request@v5
|
2021-11-23 18:15:31 +00:00
|
|
|
id: cpr
|
2021-08-23 14:54:58 +01:00
|
|
|
with:
|
2023-05-31 13:23:04 +01:00
|
|
|
token: ${{ steps.generate_token.outputs.token }}
|
2021-08-23 14:54:58 +01:00
|
|
|
branch: update-web-api-client
|
2022-08-16 12:41:23 +01:00
|
|
|
commit-message: "web: bump API Client version"
|
|
|
|
title: "web: bump API Client version"
|
|
|
|
body: "web: bump API Client version"
|
2021-08-23 14:54:58 +01:00
|
|
|
delete-branch: true
|
|
|
|
signoff: true
|
2023-06-01 20:17:37 +01:00
|
|
|
# ID from https://api.github.com/users/authentik-automation[bot]
|
|
|
|
author: authentik-automation[bot] <135050075+authentik-automation[bot]@users.noreply.github.com>
|
2023-03-24 10:01:13 +00:00
|
|
|
- uses: peter-evans/enable-pull-request-automerge@v3
|
2023-01-11 16:15:19 +00:00
|
|
|
with:
|
2023-05-31 13:23:04 +01:00
|
|
|
token: ${{ steps.generate_token.outputs.token }}
|
2023-01-11 16:15:19 +00:00
|
|
|
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
|
|
|
|
merge-method: squash
|