Skip to content
Open
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
24 changes: 7 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- master
- dev
workflow_run:
workflows:
workflows:
- Update API client
- Update API client (dev)
types:
Expand All @@ -22,8 +22,10 @@ permissions:
jobs:
publish:
if:
(github.event.workflow_run.name == 'Update API client' || github.event.pull_request.base.ref == 'master') &&
(github.event.pull_request.merged == true || github.event.workflow_run.conclusion == 'success')
(github.event.workflow_run.name == 'Update API client' ||
github.event.pull_request.base.ref == 'master') &&
(github.event.pull_request.merged == true ||
github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-latest

env:
Expand Down Expand Up @@ -68,12 +70,6 @@ jobs:
- 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 == 'master' || github.ref ==
Expand All @@ -90,10 +86,10 @@ jobs:
--tag-version-prefix ""
fi


publish-dev:
if:
github.event.workflow_run.name == 'Update API client (dev)' && github.event.workflow_run.conclusion == 'success'
github.event.workflow_run.name == 'Update API client (dev)' &&
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest

env:
Expand Down Expand Up @@ -139,12 +135,6 @@ jobs:
- 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 🚀
run: |
git describe --exact-match --tags || code=$?
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependsOn": ["^build"]
},
"build:write-version-file": {
"cache": true,
"cache": false,
"dependsOn": ["build"]
},
"lint": {
Expand Down
4 changes: 3 additions & 1 deletion packages/mittwald/dev/writeVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { readPackage } from "read-pkg";
import * as fs from "node:fs";
import * as path from "node:path";

const { version } = await readPackage();
const { version } = await readPackage({
cwd: path.join(import.meta.dirname, ".."),
});

const distFolder = path.join(import.meta.dirname, "../dist");

Expand Down
3 changes: 2 additions & 1 deletion packages/mittwald/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"lint": "run eslint .",
"test": "",
"test:client-generation-clean": "git diff --exit-code",
"test:compile": "run tsc --noEmit"
"test:compile": "run tsc --noEmit",
"version": "run build:write-version-file"
},
"dependencies": {
"@mittwald/api-client-commons": "workspace:^",
Expand Down
Loading