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.
This commit is contained in:
2024-08-14 21:22:06 +02:00
parent 5ac3918ca2
commit f7dc771e0a
2 changed files with 21 additions and 10 deletions

View File

@@ -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 }}

View File

@@ -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 .",