@@ -28,13 +28,46 @@ jobs:
2828
2929 - name : Setup npm publish
3030 run :
31- echo "//registry.npmjs.org/:_authToken=${{ secrets. NPM_TOKEN }}" >> ./.npmrc
31+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ./.npmrc
3232
33- - name : Create Release
33+ - name : Build
3434 env :
3535 GH_TOKEN : ${{ secrets.RELEASE_TOKEN }}
3636 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
3737 run : |
3838 npm install
3939 npm run build
40- npm run release
40+
41+ - name : Determine Semver
42+ env :
43+ GH_TOKEN : ${{ secrets.RELEASE_TOKEN }}
44+ run : |
45+ echo "SEMVER_TYPE=$(npx auto version)" >> $GITHUB_ENV
46+
47+ - name : Publish Packages
48+ env :
49+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
50+ SEMVER_TYPE : prepatch # just to avoid publishing real 2.0.0
51+ run : |
52+ npx lerna version ${{ env.SEMVER_TYPE }} --force-publish --ignore-changes --preid rc --yes --message "Bump versions [skip ci]"
53+ #npx lerna publish from-git --yes
54+ echo "NEXT_VERSION=$(yq e '.version' -o yaml lerna.json)" >> $GITHUB_ENV
55+
56+ - name : Build changelog
57+ id : build_changelog
58+ uses : mikepenz/release-changelog-builder-action@v3
59+ with :
60+ configuration : " .github/changelog-configuration.json"
61+ outputFile : .github/release-notes.md
62+ # PreReleases still get a changelog, but the next full release gets a diff since the last full release,
63+ # combining possible changelogs of all previous PreReleases in between.
64+ # PreReleases show a partial changelog since last PreRelease.
65+ ignorePreReleases : " ${{ !contains(env.NEXT_VERSION, '-rc') }}"
66+ env :
67+ GITHUB_TOKEN : ${{ github.token }}
68+
69+ - name : Create Release
70+ env :
71+ GITHUB_TOKEN : ${{ secrets.RELEASE_TOKEN }}
72+ run : |
73+ gh release create "v${{ env.NEXT_VERSION }}" --notes-file .github/release-notes.md --prerelease=${{ contains(env.NEXT_VERSION, '-rc') }} --title "v${{ env.NEXT_VERSION }}"
0 commit comments