From 33dae0c38002ac01440a5a46192c2904786ed4ba Mon Sep 17 00:00:00 2001 From: b3hr4d Date: Sat, 24 Feb 2024 16:34:40 +0300 Subject: [PATCH] Add GitHub release action for creating a release --- .github/workflows/deploy-test.yml | 8 ++++ .github/workflows/release.yml | 68 ------------------------------- packages/core/package.json | 2 +- 3 files changed, 9 insertions(+), 69 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml index cf5544d7c9..f7aef70500 100644 --- a/.github/workflows/deploy-test.yml +++ b/.github/workflows/deploy-test.yml @@ -24,3 +24,11 @@ jobs: - name: Build run: yarn build + + - uses: actions/checkout@v3 + - name: Create a Release + uses: elgohr/Github-Release-Action@v5 + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + with: + title: Release ${{ github.ref }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index dc7605a249..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Build and Release - -on: - workflow_dispatch: # Allows manual triggering from the GitHub UI - push: - tags: - - "v*" # Triggers on tag push matching v1.0, v1.1, etc. - -jobs: - build-and-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: "20" - cache: "yarn" - - - name: Install Yarn - run: npm install -g yarn - - - name: Install dependencies - run: yarn install - - - name: Build - run: yarn bundle - - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref_name }} - draft: false - prerelease: false - - - name: Upload Production Bundle - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./packages/core/umd/production/index.min.js - asset_name: core.min.js - asset_content_type: application/javascript - - - name: Upload Development Bundle - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./packages/core/umd/development/index.js - asset_name: core.js - asset_content_type: application/javascript - - - name: Upload Development Source Map - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./packages/core/umd/development/index.js.map - asset_name: core.js.map - asset_content_type: application/json diff --git a/packages/core/package.json b/packages/core/package.json index 600fac82ce..15a87f5b77 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -40,7 +40,7 @@ "bundle": "npm run bundle:dev && npm run bundle:prod", "bundle:dev": "npx webpack --mode development", "bundle:prod": "npx webpack --mode production", - "build": "npx tsc", + "build": "npx tsc && npm run bundle", "clean": "npx rimraf dist" }, "engines": {