From be40f37d6cb6fd154f0dcdeca4f2a2c1faf66975 Mon Sep 17 00:00:00 2001 From: Joseph Phelan Date: Wed, 17 Jan 2024 08:38:58 -0600 Subject: [PATCH] try buildkite --- .buildkite/deploy.sh | 18 ++++++++++++++++++ .buildkite/pipeline.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 20 -------------------- 3 files changed, 49 insertions(+), 20 deletions(-) create mode 100755 .buildkite/deploy.sh create mode 100644 .buildkite/pipeline.yml delete mode 100644 .github/workflows/publish.yml diff --git a/.buildkite/deploy.sh b/.buildkite/deploy.sh new file mode 100755 index 00000000..c6ec7185 --- /dev/null +++ b/.buildkite/deploy.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -euo pipefail + +# Get the tag version from Buildkite or default to a pre-release tag +TAG_VERSION=$(buildkite-agent meta-data get "tag-version" --default "0.0.0-alpha-$(date +%Y%m%d%H%M%S)") +TAG_VERSION=${TAG_VERSION/v/} + +# Publish the package +sed -i "s/0.0.0-ci-released/$TAG_VERSION/g" package.json +yarn npm publish --tag ${NPM_TAG} + +# Annotate the build with the types version +buildkite-agent annotate --style success "Published types to \`@widen/react-modal@${TAG_VERSION}\`. Install with the following command: + +\`\`\`bash +yarn add @widen/react-modal@${TAG_VERSION} +\`\`\` +" diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 00000000..c12581f9 --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,31 @@ +steps: + - label: ":spiral_note_pad: Build" + command: ./bksh add-release-block-step-from-draft + branches: main + agents: + queue: builder + + - wait + + - label: ":git: Create release" + command: ./bksh create-release + branches: main + agents: + queue: builder + + - wait + + - label: ":git: Delete draft release" + command: "./bksh delete-draft-release" + branches: main + agents: + queue: builder + + - label: ":rocket: Release" + command: .buildkite/deploy.sh + branches: main + agents: + queue: deploy-prod + plugins: *docker + env: + NPM_TAG: latest diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 55af0d7f..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Publish Package -on: - release: - types: [published] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-node@v3 - with: - node-version: "20.x" - - run: yarn install --immutable - - run: yarn publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }}