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:
24
.github/workflows/CreateRelease.yml
vendored
24
.github/workflows/CreateRelease.yml
vendored
@@ -72,7 +72,16 @@ jobs:
|
|||||||
echo "$notes" >> release_notes.md
|
echo "$notes" >> release_notes.md
|
||||||
shell: bash
|
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
|
id: create_tag
|
||||||
run: |
|
run: |
|
||||||
git tag ${{ env.VERSION }}
|
git tag ${{ env.VERSION }}
|
||||||
@@ -81,17 +90,18 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: Delete temporary branch
|
||||||
|
id: delete_temp_branch
|
||||||
|
run: |
|
||||||
|
git checkout main
|
||||||
|
git branch -D temp_branch
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ env.VERSION }}
|
tag_name: ${{ env.VERSION }}
|
||||||
name: Release ${{ env.VERSION }}
|
name: Release ${{ env.VERSION }}
|
||||||
body_path: release_notes.md
|
body_path: release_notes.md
|
||||||
# files: |
|
|
||||||
# ./dist/**
|
|
||||||
# ./README.md
|
|
||||||
# ./LICENSE
|
|
||||||
# ./package.json
|
|
||||||
# ./tsconfig.json
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "ts-injex",
|
"name": "ts-injex",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "dist/index.js",
|
"type": "module",
|
||||||
"types": "dist/index.d.ts",
|
"main": "./dist/index.js",
|
||||||
|
"types": "./dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:tsc": "tsc",
|
"build:tsc": "tsc",
|
||||||
"lint": "eslint --ext .ts .",
|
"lint": "eslint --ext .ts .",
|
||||||
|
Reference in New Issue
Block a user