From f7dc771e0a2426e49d45b77cc0c4676bebab2281 Mon Sep 17 00:00:00 2001 From: Max P Date: Wed, 14 Aug 2024 21:22:06 +0200 Subject: [PATCH] Automate release workflow, bump version to 0.0.3 Added the creation of a temporary branch to stage release files before tagging, ensuring a clean release environment. Adjusted the tag creation process and included steps to delete the temporary branch post-tagging. Updated `package.json` to version 0.0.3 and set module type for better compatibility. --- .github/workflows/CreateRelease.yml | 24 +++++++++++++++++------- package.json | 7 ++++--- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CreateRelease.yml b/.github/workflows/CreateRelease.yml index 0099559..ec78ec7 100644 --- a/.github/workflows/CreateRelease.yml +++ b/.github/workflows/CreateRelease.yml @@ -72,7 +72,16 @@ jobs: echo "$notes" >> release_notes.md shell: bash - - name: Create Tag + - name: Create temporary branch + id: create_temp_branch + run: | + git checkout --orphan temp_branch + git reset --hard + git add README.md package.json LICENSE dist/** + git commit -m "Prepare files for release ${env.VERSION}" + shell: bash + + - name: Create and push tag id: create_tag run: | git tag ${{ env.VERSION }} @@ -81,17 +90,18 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash + - name: Delete temporary branch + id: delete_temp_branch + run: | + git checkout main + git branch -D temp_branch + shell: bash + - name: Release uses: softprops/action-gh-release@v2 with: tag_name: ${{ env.VERSION }} name: Release ${{ env.VERSION }} body_path: release_notes.md - # files: | - # ./dist/** - # ./README.md - # ./LICENSE - # ./package.json - # ./tsconfig.json env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 99028a8..94dcdc8 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "ts-injex", - "version": "0.0.2", + "version": "0.0.3", "description": "", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "type": "module", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "scripts": { "build:tsc": "tsc", "lint": "eslint --ext .ts .",