From c330a9550d324fa1d6919b80da9b4ae529bdde97 Mon Sep 17 00:00:00 2001 From: Stoney_Eagle <45034970+StoneyEagle@users.noreply.github.com> Date: Sat, 4 Jan 2025 18:57:06 +0100 Subject: [PATCH 01/11] Create create-release.yml --- .github/workflows/create-release.yml | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/create-release.yml diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..d2818d8 --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,35 @@ +on: + workflow_dispatch: + push: + +name: Create Release + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Create Draft 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 }} + draft: true + prerelease: false + + - uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./release-${{ github.ref }}.zip + asset_name: release-${{ github.ref }}.zip + asset_content_type: application/zip + + - uses: eregon/publish-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ steps.create_release.outputs.id }} From 0a951ea033499634bd38337616de4a4f93343ba8 Mon Sep 17 00:00:00 2001 From: Stoney_Eagle <45034970+StoneyEagle@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:05:56 +0100 Subject: [PATCH 02/11] Update create-release.yml --- .github/workflows/create-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index d2818d8..1403874 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -24,8 +24,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./release-${{ github.ref }}.zip - asset_name: release-${{ github.ref }}.zip + asset_path: ./my-artifact.zip + asset_name: my-artifact.zip asset_content_type: application/zip - uses: eregon/publish-release@v1 From c1f8cbd6a99c7f68f505e7036b986044405c518a Mon Sep 17 00:00:00 2001 From: Stoney_Eagle <45034970+StoneyEagle@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:07:47 +0100 Subject: [PATCH 03/11] Update create-release.yml --- .github/workflows/create-release.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 1403874..068c6de 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -19,15 +19,6 @@ jobs: draft: true prerelease: false - - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./my-artifact.zip - asset_name: my-artifact.zip - asset_content_type: application/zip - - uses: eregon/publish-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 84b5687518da9db1ae151c3992345b33934bf0ca Mon Sep 17 00:00:00 2001 From: Stoney_Eagle <45034970+StoneyEagle@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:11:18 +0100 Subject: [PATCH 04/11] Delete .github/workflows/create-release.yml --- .github/workflows/create-release.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/workflows/create-release.yml diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml deleted file mode 100644 index 068c6de..0000000 --- a/.github/workflows/create-release.yml +++ /dev/null @@ -1,26 +0,0 @@ -on: - workflow_dispatch: - push: - -name: Create Release - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Create Draft 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 }} - draft: true - prerelease: false - - - uses: eregon/publish-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - release_id: ${{ steps.create_release.outputs.id }} From 4ac470443f24f5b6a7cd4cbca7a1b74a698d2ec3 Mon Sep 17 00:00:00 2001 From: Stoney_Eagle <45034970+StoneyEagle@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:18:26 +0100 Subject: [PATCH 05/11] Create release.yml --- .github/workflows/release.yml | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..97f900e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Create Release + +on: + push: + workflow_dispatch: + +jobs: + create-release: + runs-on: ubuntu-latest + + steps: + # Step 1: Check out the code + - name: Checkout code + uses: actions/checkout@v4 + + # Step 2: Set up Node.js + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 'lts' # Use the latest LTS version of Node.js + + # Step 3: Read the version from package.json + - name: Get version from package.json + id: get_version + run: | + echo "PACKAGE_VERSION=$(node -p \"require('./package.json').version\")" >> $GITHUB_ENV + + # Step 4: Create the tag + - name: Create tag + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag -a "v${PACKAGE_VERSION}" -m "Release v${PACKAGE_VERSION}" + git push origin "v${PACKAGE_VERSION}" + + # Step 5: Create GitHub release + - name: Create GitHub Release + uses: actions/create-release@v1 + with: + tag_name: "v${{ env.PACKAGE_VERSION }}" + release_name: "Release v${{ env.PACKAGE_VERSION }}" + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e6b958dcb4afc7b295382886d35cf294cbedc07e Mon Sep 17 00:00:00 2001 From: Stoney_Eagle <45034970+StoneyEagle@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:21:42 +0100 Subject: [PATCH 06/11] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97f900e..2a381c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: 'lts' # Use the latest LTS version of Node.js + node-version: '16' # Use the latest LTS version of Node.js # Step 3: Read the version from package.json - name: Get version from package.json From 66c5466d9944741596b0543125bf7261a9116e7c Mon Sep 17 00:00:00 2001 From: Stoney_Eagle <45034970+StoneyEagle@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:24:50 +0100 Subject: [PATCH 07/11] Update release.yml --- .github/workflows/release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a381c6..2072384 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,8 +23,9 @@ jobs: - name: Get version from package.json id: get_version run: | - echo "PACKAGE_VERSION=$(node -p \"require('./package.json').version\")" >> $GITHUB_ENV - + PACKAGE_VERSION=$(node -p "require('./package.json').version") + echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV + # Step 4: Create the tag - name: Create tag run: | From 938c62a9e00bee452e8885d12f4b69129122022c Mon Sep 17 00:00:00 2001 From: Stoney_Eagle <45034970+StoneyEagle@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:31:00 +0100 Subject: [PATCH 08/11] Update release.yml --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2072384..077ba2b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,15 +31,15 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git tag -a "v${PACKAGE_VERSION}" -m "Release v${PACKAGE_VERSION}" - git push origin "v${PACKAGE_VERSION}" + git tag -a "${PACKAGE_VERSION}" -m "Release ${PACKAGE_VERSION}" + git push origin "${PACKAGE_VERSION}" # Step 5: Create GitHub release - name: Create GitHub Release uses: actions/create-release@v1 with: - tag_name: "v${{ env.PACKAGE_VERSION }}" - release_name: "Release v${{ env.PACKAGE_VERSION }}" + tag_name: "${{ env.PACKAGE_VERSION }}" + release_name: "Release ${{ env.PACKAGE_VERSION }}" draft: false prerelease: false env: From 876c4b73cb9c3919fd0fb0e02a1b546b0b93e7a0 Mon Sep 17 00:00:00 2001 From: Stoney_Eagle <45034970+StoneyEagle@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:38:37 +0100 Subject: [PATCH 09/11] Update npm-publish.yml --- .github/workflows/npm-publish.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 9c4a376..e19def2 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -5,8 +5,6 @@ name: Node.js Package on: release: - types: [created] - workflow_dispatch: jobs: From 23f4ac2aa1f5e9faccfd68bd2d21dbf4fca38eb6 Mon Sep 17 00:00:00 2001 From: Stoney_Eagle <45034970+StoneyEagle@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:46:48 +0100 Subject: [PATCH 10/11] Update npm-publish.yml --- .github/workflows/npm-publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index e19def2..76de695 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -6,6 +6,8 @@ name: Node.js Package on: release: workflow_dispatch: + workflow_run: + workflows: release jobs: build: From 2ef2cebfbb4fcd4fe4eed0255314ebc773c9a552 Mon Sep 17 00:00:00 2001 From: Stoney_Eagle <45034970+StoneyEagle@users.noreply.github.com> Date: Sat, 4 Jan 2025 19:47:18 +0100 Subject: [PATCH 11/11] Update npm-publish.yml --- .github/workflows/npm-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 76de695..bb047a7 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -5,6 +5,7 @@ name: Node.js Package on: release: + types: [created] workflow_dispatch: workflow_run: workflows: release