aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ashcon Partovi <ashcon@partovi.net> 2023-02-01 14:13:39 -0800
committerGravatar Ashcon Partovi <ashcon@partovi.net> 2023-02-01 14:13:39 -0800
commitf7a93fe2947d33fe8569ed2f1b574feb4df144b5 (patch)
treec61d45526720fec158a664bd6200d8b780476974
parent02fc87ea2952384308761380217008f66c5a824f (diff)
downloadbun-f7a93fe2947d33fe8569ed2f1b574feb4df144b5.tar.gz
bun-f7a93fe2947d33fe8569ed2f1b574feb4df144b5.tar.zst
bun-f7a93fe2947d33fe8569ed2f1b574feb4df144b5.zip
Add bun-types release to canary workflow
-rw-r--r--.github/workflows/bun-release-canary.yml47
-rw-r--r--.github/workflows/bun-types-release-canary.yml60
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