diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.yml new file mode 100644 index 0000000..3e2b708 --- /dev/null +++ b/.github/workflows/release-manual.yml @@ -0,0 +1,45 @@ +name: "Release and Publish Manual" + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + build: + name: "Build" + runs-on: ubuntu-latest + steps: + - name: "Checkout" + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "Use Node.js 16" + uses: actions/setup-node@v4 + with: + node-version: '16' + + - name: "Install dependencies" + working-directory: ./ + run: npm ci + + - name: "Run build" + run: lerna run build + + - name: "Version and publish" # Interesting step + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + + if [ ${{ github.base_ref }} = development ]; then + npx lerna version --conventional-commits --conventional-prerelease --preid beta --yes + else + npx lerna version --conventional-commits --conventional-graduate --yes + fi + + npx lerna publish from-git --yes + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9bb7972..4987d86 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,13 +34,10 @@ jobs: git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" - npx lerna publish from-git --yes - -# git config user.name "${{ github.actor }}" -# git config user.email "${{ github.actor}}@users.noreply.github.com" -# -# if [ ${{ github.base_ref }} = development ]; then -# npx lerna version --conventional-commits --conventional-prerelease --preid beta --yes -# else -# npx lerna version --conventional-commits --conventional-graduate --yes -# fi + if [ ${{ github.base_ref }} = development ]; then + npx lerna version --conventional-commits --conventional-prerelease --preid beta --yes + else + npx lerna version --conventional-commits --conventional-graduate --yes + fi + + npx lerna publish from-git --yes \ No newline at end of file