diff --git a/.github/workflows/create-pre-release-pr.yml b/.github/workflows/create-pre-release-pr.yml deleted file mode 100644 index 69f7338bf..000000000 --- a/.github/workflows/create-pre-release-pr.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: โ†—๏ธ Create a Pull request for a new release -# Event for the workflow -on: - workflow_dispatch: - -# Allow one concurrent deployment -concurrency: - group: "publish" - cancel-in-progress: true - - -jobs: - create-pre-release-pr: - permissions: - contents: write - pull-requests: write - - runs-on: ubuntu-latest - steps: - - name: 'Checkout source code' - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Checkout all branches and tags - token: ${{ secrets.GITHUB_TOKEN }} - fetch-tags: true - - - uses: actions/setup-node@v4 - with: - node-version: '20.x' - registry-url: 'https://registry.npmjs.org' - scope: '@kaoto-next' - cache: 'yarn' - - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' - - - name: ๐Ÿ”ง Install dependencies - run: yarn - - - name: ๐Ÿงช Run tests - run: yarn workspaces foreach --verbose --topological-dev run test - - # Build lib - - name: Build @kaoto-next/ui package in lib mode - run: yarn workspace @kaoto-next/ui run build:lib - - - name: Git user config - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - - name: Version - run: yarn version - - - name: Get version - id: get_version - run: | - echo "TITLE=$(git --no-pager log --format=%s -n 1)" >> $GITHUB_OUTPUT - # echo "BODY='$(git --no-pager log --format=%B -n 1)'" >> $GITHUB_OUTPUT - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - commit-message: "chore: release" - title: ${{ steps.get_version.outputs.TITLE }} - body: ${{ steps.get_version.outputs.BODY }} - branch: chore/pre-release - base: main - token: ${{ secrets.GITHUB_TOKEN }} - delete-branch: true - labels: release diff --git a/.github/workflows/publish-npm-package.yml b/.github/workflows/publish-npm-package.yml deleted file mode 100644 index 2f292f50b..000000000 --- a/.github/workflows/publish-npm-package.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: ๐Ÿท๏ธ Publish a new version of the package -on: - # We publish a new version when a release is created - release: - types: [published] - -jobs: - release-and-publish: - permissions: - contents: write - - runs-on: ubuntu-latest - steps: - - name: 'Checkout source code' - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: '20.x' - registry-url: 'https://registry.npmjs.org' - scope: '@kaoto-next' - cache: 'yarn' - - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' - - - name: ๐Ÿ”ง Install dependencies - run: yarn - - # Build lib - - name: Build @kaoto-next/ui package in lib mode - run: yarn workspace @kaoto-next/ui run build:lib - - # Version and publish - - name: 'Version and publish' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.KAOTO_NEXT_NPM_TOKEN }} - run: yarn publish diff --git a/.github/workflows/release-pipeline.yml b/.github/workflows/release-pipeline.yml new file mode 100644 index 000000000..60b5f49d0 --- /dev/null +++ b/.github/workflows/release-pipeline.yml @@ -0,0 +1,58 @@ +name: Release Pipeline, create a tag/release for Kaoto Next and invoke publish NPM Package +on: + workflow_dispatch: + inputs: + tag_version: + type: The tag to release + description: The tag version we want to release + required: true + +jobs: + build: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Bump version and push tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + custom_tag: ${{ github.event.inputs.tag_version }} + create_annotated_tag: true + tag_prefix: "" + + - name: Create a GitHub release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.tag_version.outputs.new_tag }} + name: Release ${{ steps.tag_version.outputs.new_tag }} + body: ${{ steps.tag_version.outputs.changelog }} + + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + scope: '@kaoto-next' + cache: 'yarn' + + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + + - name: ๐Ÿ”ง Install dependencies + run: yarn + + # Build lib + - name: Build @kaoto-next/ui package in lib mode + run: yarn workspace @kaoto-next/ui run build:lib + + # Version and publish + - name: 'Version and publish' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.KAOTO_NEXT_NPM_TOKEN }} + run: yarn publish