-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/master' into add-us…
…er-model
- Loading branch information
Showing
60 changed files
with
12,733 additions
and
40,335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Publish development packages to NPM | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- dev | ||
workflow_run: | ||
workflows: [Update API client (dev)] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
publish: | ||
if: | ||
github.event.pull_request.merged == true || | ||
github.event.workflow_run.conclusion == 'success' | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
PUBLISH_PAT: ${{ secrets.PUBLISH_PAT }} | ||
GH_TOKEN: ${{ secrets.PUBLISH_PAT }} | ||
|
||
steps: | ||
- name: Checkout ⬇️ | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PUBLISH_PAT }} | ||
ref: ${{ github.event.workflow_run.head_branch }} | ||
|
||
- name: Setup Node 🎛️ | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "yarn" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Git Identity 🪪 | ||
run: | | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
- name: Yarn Install 📦️ | ||
run: yarn install --immutable | ||
|
||
- name: Setup NX 1/2 🎛️ | ||
uses: nrwl/nx-set-shas@v4 | ||
with: | ||
main-branch-name: dev | ||
|
||
# This step is needed for nx affected to work when CI is running on a PR | ||
# See also https://nx.dev/ci/recipes/set-up/monorepo-ci-github-actions#configuring-ci-using-github-actions-and-nx | ||
- name: Setup NX 2/2 🎛 | ||
if: | ||
(github.ref != 'refs/heads/dev' && | ||
github.event.workflow_run.head_branch != 'dev') | ||
run: git branch --track dev origin/dev | ||
|
||
- name: Build 🔨 | ||
run: yarn nx affected -t build --parallel=3 | ||
|
||
# TODO: Uses the previous version. Needs a fix! | ||
- name: Create version file 🔢 | ||
run: | | ||
yarn nx run @mittwald/api-client:build:write-version-file | ||
git add . | ||
- name: Version and publish 🚀 | ||
if: | ||
github.event.workflow_run.head_branch == 'dev' || github.ref == | ||
'refs/heads/dev' | ||
run: | | ||
yarn lerna publish 0.0.0-development-$(git rev-parse --short=7 HEAD)-$(date +%Y%m%d) \ | ||
--message "chore(release): bump version to %v" \ | ||
--yes --no-private \ | ||
--tag-version-prefix "" \ | ||
--dist-tag development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Update API client (dev) | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- dev | ||
paths: | ||
- packages/mittwald/spec/openapi-dev.json | ||
|
||
jobs: | ||
update-client: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
PUBLISH_PAT: ${{ secrets.PUBLISH_PAT }} | ||
GH_TOKEN: ${{ secrets.PUBLISH_PAT }} | ||
|
||
steps: | ||
- name: Checkout ⬇️ | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PUBLISH_PAT }} | ||
|
||
- name: Git Identity 🪪 | ||
run: | | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
- name: Yarn Install 📦️ | ||
run: yarn install --immutable | ||
|
||
- name: Setup NX 1/2 🎛️ | ||
uses: nrwl/nx-set-shas@v4 | ||
|
||
- name: Setup NX 2/2 🎛 | ||
if: github.ref != 'refs/heads/dev' | ||
run: git branch --track master origin/dev | ||
|
||
- name: Merge in master ⛙ | ||
run: | | ||
git merge refs/remotes/origin/master --strategy-option theirs | ||
- name: Update OpenAPI ⬇️ | ||
if: github.ref == 'refs/heads/dev' | ||
run: | | ||
yarn nx run @mittwald/api-client:build:fetch-openapi-dev | ||
if [ $(git status --porcelain . | wc -l) -gt 0 ] ; then | ||
yarn nx run @mittwald/api-client:build:client-dev | ||
git add . | ||
yarn test | ||
git commit -m "chore: update generated development client"; | ||
git push origin | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.