diff options
-rw-r--r-- | .github/workflows/bun-release-canary.yml | 47 | ||||
-rw-r--r-- | .github/workflows/bun-types-release-canary.yml | 60 |
2 files changed, 47 insertions, 60 deletions
diff --git a/.github/workflows/bun-release-canary.yml b/.github/workflows/bun-release-canary.yml index 88a094f2f..122575b3c 100644 --- a/.github/workflows/bun-release-canary.yml +++ b/.github/workflows/bun-release-canary.yml @@ -30,6 +30,53 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + npm-types: + name: Release types to NPM + runs-on: ubuntu-latest + defaults: + run: + working-directory: packages/bun-types + steps: + - id: checkout + name: Checkout + uses: actions/checkout@v3 + - id: setup-env + name: Setup Environment + run: | + SHA=$(git rev-parse --short "$GITHUB_SHA") + TAG="${{ github.event.inputs.tag }}" + TAG="${TAG:-"${{ github.event.release.tag_name }}"}" + TAG="${TAG}-canary.$(date '+%Y%m%d').1+${SHA}" + echo "Setup tag: ${TAG}" + echo "TAG=${TAG}" >> ${GITHUB_ENV} + - id: setup-node + name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: latest + - id: setup-bun + name: Setup Bun + uses: oven-sh/setup-bun@v0.1.8 + with: + bun-version: canary + github-token: ${{ secrets.GITHUB_TOKEN }} + - id: bun-install + name: Install Dependencies + run: | + bun upgrade --canary + bun install + - id: bun-run + name: Build + run: bun run build + env: + BUN_VERSION: ${{ env.TAG }} + - id: npm-publish + name: Release + uses: JS-DevTools/npm-publish@v1 + with: + package: packages/bun-types/dist/package.json + token: ${{ secrets.NPM_TOKEN }} + tag: canary docker: name: Release to Dockerhub runs-on: ubuntu-latest diff --git a/.github/workflows/bun-types-release-canary.yml b/.github/workflows/bun-types-release-canary.yml deleted file mode 100644 index 8f6b30fca..000000000 --- a/.github/workflows/bun-types-release-canary.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Release bun-types@canary -on: - push: - branches: [main] - paths: - - 'packages/bun-types/**' -jobs: - tests: - name: Build, test, publish canary - runs-on: ubuntu-latest - if: github.repository_owner == 'oven-sh' - defaults: - run: - working-directory: packages/bun-types - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Install Node - uses: actions/setup-node@v3 - with: - node-version: latest - - - name: Install Bun - uses: oven-sh/setup-bun@v0.1.8 - with: - bun-version: canary - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install dependencies - run: bun install - - - name: Generate package - run: bun run build - - - name: Tests - run: bun run test - - - name: Set temp version - working-directory: packages/bun-types/dist - run: | - git_hash=$(git rev-parse --short "$GITHUB_SHA") - new_pkg_version="$(bun --version)-canary.${git_hash}" - echo "new_pkg_version" - echo "${new_pkg_version}" - npm version ${new_pkg_version} --no-git-tag-version - - name: Publish to NPM - uses: JS-DevTools/npm-publish@v1 - with: - package: packages/bun-types/dist/package.json - token: ${{ secrets.NPM_BUN_TYPES_TOKEN }} - # dry-run: true - tag: canary - - # - name: Publish on NPM - # working-directory: packages/bun-types/dist - # run: npm publish --access public --tag canary # --dry-run - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # NODE_AUTH_TOKEN: ${{ secrets.NPM_BUN_TYPES_TOKEN }}
\ No newline at end of file |