From 5b97481bc6ccd76ace2f6ae057be91a5ebf1826c Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 19:42:02 +0100 Subject: [PATCH 01/21] workflow:added workflow file --- .github/workflows/release.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) 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..e69de29 From 62c5dac505c63ead08fe7c196b67e6ca779259b9 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 19:47:32 +0100 Subject: [PATCH 02/21] workflow: modified workflow file --- .github/workflows/release.yml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e69de29..4aab6d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Create Source Code Package + +on: + push: + branches: + - main + +jobs: + create_release: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Git + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + + - name: Get the current date and time + id: datetime + run: echo "RELEASE_TIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV + + - name: Create a source code package + run: | + mkdir -p release + git archive -o release/source-code-${{ env.RELEASE_TIME }}.zip HEAD + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ env.RELEASE_TIME }} + release_name: Release v${{ env.RELEASE_TIME }} + draft: false + prerelease: false + + - name: Upload Source Code Package + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: release/source-code-${{ env.RELEASE_TIME }}.zip + asset_name: source-code-${{ env.RELEASE_TIME }}.zip + asset_content_type: application/zip From 198d92d1b361456c6cf18c9ba6b530bf09768c7b Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 19:58:45 +0100 Subject: [PATCH 03/21] workflow: modified workflow file --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4aab6d5..0c6b070 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: id: create_release uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} with: tag_name: v${{ env.RELEASE_TIME }} release_name: Release v${{ env.RELEASE_TIME }} @@ -41,7 +41,7 @@ jobs: - name: Upload Source Code Package uses: actions/upload-release-asset@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: release/source-code-${{ env.RELEASE_TIME }}.zip From 6e4db9ef58421ec0abec9e76c3e6b0e4b6064e2c Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 20:02:14 +0100 Subject: [PATCH 04/21] workflow: modified workflow file --- .github/workflows/release.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0c6b070..1916c71 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,20 +30,18 @@ jobs: - name: Create Release id: create_release uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} with: tag_name: v${{ env.RELEASE_TIME }} release_name: Release v${{ env.RELEASE_TIME }} draft: false prerelease: false + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - name: Upload Source Code Package uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: release/source-code-${{ env.RELEASE_TIME }}.zip asset_name: source-code-${{ env.RELEASE_TIME }}.zip asset_content_type: application/zip + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} From 4db470e468de24212cdce3eb6576cbfce2dddc70 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 20:05:04 +0100 Subject: [PATCH 05/21] workflow: modified workflow file --- .github/workflows/release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1916c71..4aab6d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,18 +30,20 @@ jobs: - name: Create Release id: create_release uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: v${{ env.RELEASE_TIME }} release_name: Release v${{ env.RELEASE_TIME }} draft: false prerelease: false - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - name: Upload Source Code Package uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: release/source-code-${{ env.RELEASE_TIME }}.zip asset_name: source-code-${{ env.RELEASE_TIME }}.zip asset_content_type: application/zip - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} From d21626dd6b9862718cbd5ec34cf753accb3db455 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 20:25:50 +0100 Subject: [PATCH 06/21] workflow: modified workflow file --- .github/workflows/release.yml | 70 +++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4aab6d5..1993c0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,49 +1,65 @@ -name: Create Source Code Package +name: Create Release on: push: branches: - - main + - main # Trigger on push to the main branch jobs: - create_release: + build: + name: Create Release runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v2 # Checkout the repository - name: Set up Git run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' - - name: Get the current date and time - id: datetime - run: echo "RELEASE_TIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV - - - name: Create a source code package + - name: Create Tag + id: create_tag run: | - mkdir -p release - git archive -o release/source-code-${{ env.RELEASE_TIME }}.zip HEAD + TAG="v$(date +'%Y.%m.%d-%H.%M.%S')" + git tag $TAG + git push origin $TAG + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Generate Release Notes + id: generate_notes + uses: actions/github-script@v6 + with: + script: | + const { context, github } = require('@actions/github'); + const owner = context.repo.owner; + const repo = context.repo.repo; + const tag = context.ref.replace('refs/tags/', ''); + + const { data: commits } = await github.repos.listCommits({ + owner, + repo, + sha: tag, + per_page: 100 + }); + + let body = 'Changes in this Release\n'; + for (const commit of commits) { + body += `- ${commit.commit.message}\n`; + } + + return body; - name: Create Release id: create_release uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token provided by Actions with: - tag_name: v${{ env.RELEASE_TIME }} - release_name: Release v${{ env.RELEASE_TIME }} + tag_name: ${{ steps.create_tag.outputs.TAG }} # Use the created tag name + release_name: Release ${{ steps.create_tag.outputs.TAG }} # Name the release + body: ${{ steps.generate_notes.outputs.result }} # Use generated release notes draft: false prerelease: false - - - name: Upload Source Code Package - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: release/source-code-${{ env.RELEASE_TIME }}.zip - asset_name: source-code-${{ env.RELEASE_TIME }}.zip - asset_content_type: application/zip From 650237355b33a959dfbd6aa816a0a80e5a117584 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 20:30:20 +0100 Subject: [PATCH 07/21] workflow: modified workflow file --- .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 1993c0a..7f419da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: git tag $TAG git push origin $TAG env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - name: Generate Release Notes id: generate_notes From ad16d89feff6e49a3d0eb8549e1e588cae1cb1e1 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 20:31:33 +0100 Subject: [PATCH 08/21] workflow: modified workflow file --- .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 7f419da..5053895 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: id: create_release uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token provided by Actions + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN}} # GitHub token provided by Actions with: tag_name: ${{ steps.create_tag.outputs.TAG }} # Use the created tag name release_name: Release ${{ steps.create_tag.outputs.TAG }} # Name the release From 9220ace39442eb121713a3a827dce57ccff8122d Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 20:34:17 +0100 Subject: [PATCH 09/21] workflow: modified workflow file --- .github/workflows/release.yml | 54 ++++++----------------------------- 1 file changed, 8 insertions(+), 46 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5053895..82b6e3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,61 +5,23 @@ on: branches: - main # Trigger on push to the main branch +name: Create Release + jobs: build: name: Create Release runs-on: ubuntu-latest - steps: - name: Checkout code - uses: actions/checkout@v2 # Checkout the repository - - - name: Set up Git - run: | - git config --global user.name 'github-actions' - git config --global user.email 'github-actions@github.com' - - - name: Create Tag - id: create_tag - run: | - TAG="v$(date +'%Y.%m.%d-%H.%M.%S')" - git tag $TAG - git push origin $TAG - env: - GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - - name: Generate Release Notes - id: generate_notes - uses: actions/github-script@v6 - with: - script: | - const { context, github } = require('@actions/github'); - const owner = context.repo.owner; - const repo = context.repo.repo; - const tag = context.ref.replace('refs/tags/', ''); - - const { data: commits } = await github.repos.listCommits({ - owner, - repo, - sha: tag, - per_page: 100 - }); - - let body = 'Changes in this Release\n'; - for (const commit of commits) { - body += `- ${commit.commit.message}\n`; - } - - return body; - + uses: actions/checkout@v2 - name: Create Release id: create_release uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN}} # GitHub token provided by Actions + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token with: - tag_name: ${{ steps.create_tag.outputs.TAG }} # Use the created tag name - release_name: Release ${{ steps.create_tag.outputs.TAG }} # Name the release - body: ${{ steps.generate_notes.outputs.result }} # Use generated release notes + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false - prerelease: false + prerelease: false \ No newline at end of file From 15919eac2069292b1e96b0cfaa3782fbb6262dc4 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 20:35:35 +0100 Subject: [PATCH 10/21] workflow: modified workflow file --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 82b6e3a..0131fae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,6 @@ on: branches: - main # Trigger on push to the main branch -name: Create Release jobs: build: From cb90577e3bc69f15c89fd74046094e18d34f4341 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 20:36:38 +0100 Subject: [PATCH 11/21] workflow: modified workflow file --- .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 0131fae..3716948 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: id: create_release uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # This token is provided by Actions, you do not need to create your own token with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} From 5c4d633cb61bf525dbcef16c1a26edeb504f14e7 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 20:42:40 +0100 Subject: [PATCH 12/21] workflow: modified workflow file --- .github/workflows/release.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3716948..f0f93c0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,20 +7,23 @@ on: jobs: - build: - name: Create Release + release: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # This token is provided by Actions, you do not need to create your own token + - uses: actions/checkout@v3 + + - name: Install GitHub CLI + uses: google/github-actions@v4 with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} + token: ${{ secrets.GITHUB_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - draft: false - prerelease: false \ No newline at end of file + - name: Create Release + run: | + gh release create "$GITHUB_REF" \ + --repo="$GITHUB_REPOSITORY" \ + --title="${GITHUB_REPOSITORY#*/} ${GITHUB_REF#v}" \ + --generate-notes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 84b05d8433b2989af029f3c04fb76e55265453e3 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 20:46:40 +0100 Subject: [PATCH 13/21] workflow: modified workflow file --- .github/workflows/release.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f0f93c0..907c233 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,18 +12,9 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install GitHub CLI - uses: google/github-actions@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Create Release - run: | - gh release create "$GITHUB_REF" \ - --repo="$GITHUB_REPOSITORY" \ - --title="${GITHUB_REPOSITORY#*/} ${GITHUB_REF#v}" \ - --generate-notes - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + uses: actions/create-release@v1 + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} # Optional: Customize the release name + body: "Automatic release for tag ${{ github.ref }}" # Optional: Release description From 41dbcfdfabed9e73b7d6467b0354508c259ef6a6 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 21:04:54 +0100 Subject: [PATCH 14/21] workflow: modified --- .github/workflows/release.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 907c233..ef01fb2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,18 +3,33 @@ name: Create Release on: push: branches: - - main # Trigger on push to the main branch - + - main # Adjust the branch as needed jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v2 + + # You may need additional setup steps depending on your project's needs + + - name: Create Tag + run: git tag v1.0.0 # Replace with your desired tag name + + - name: Push Tag + run: git push --tags - name: Create Release + id: create_release uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} # Optional: Customize the release name - body: "Automatic release for tag ${{ github.ref }}" # Optional: Release description + tag_name: v1.0.0 # Replace with the tag you created + release_name: Release v1.0.0 # Replace with your desired release name + body: | + Release notes for v1.0.0 + - Feature 1 implemented + - Bug fixes + From a281fb49bb747e97877fb09e37bd9c263288da9c Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 21:14:42 +0100 Subject: [PATCH 15/21] workflow: modified --- .github/workflows/release.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef01fb2..9e6b405 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,13 +12,21 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - # You may need additional setup steps depending on your project's needs + # Set up Git with PAT for authentication + - name: Set up Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" - name: Create Tag run: git tag v1.0.0 # Replace with your desired tag name - name: Push Tag - run: git push --tags + env: + PAT_TOKEN: ${{ secrets.PAT_TOKEN }} + run: | + git remote set-url origin https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository }}.git + git push --tags - name: Create Release id: create_release @@ -32,4 +40,3 @@ jobs: Release notes for v1.0.0 - Feature 1 implemented - Bug fixes - From 4832504cbf12514e4ae13185ca71d151bb66cf44 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 21:28:09 +0100 Subject: [PATCH 16/21] workflow: modified --- .github/workflows/release.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e6b405..ef01fb2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,21 +12,13 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - # Set up Git with PAT for authentication - - name: Set up Git - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" + # You may need additional setup steps depending on your project's needs - name: Create Tag run: git tag v1.0.0 # Replace with your desired tag name - name: Push Tag - env: - PAT_TOKEN: ${{ secrets.PAT_TOKEN }} - run: | - git remote set-url origin https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository }}.git - git push --tags + run: git push --tags - name: Create Release id: create_release @@ -40,3 +32,4 @@ jobs: Release notes for v1.0.0 - Feature 1 implemented - Bug fixes + From ff838282868b46cabbedc92216b8d79c69c8f3d1 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 21:42:04 +0100 Subject: [PATCH 17/21] workflow: modified --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef01fb2..4e0e1b9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Create Release +name: Create or Update Release on: push: @@ -12,15 +12,34 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - # You may need additional setup steps depending on your project's needs + - name: Set up Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Check if tag exists + id: check_tag + run: | + if git rev-parse v1.0.0 >/dev/null 2>&1 + then + echo "::set-output name=tag_exists::true" + else + echo "::set-output name=tag_exists::false" + fi - name: Create Tag + if: steps.check_tag.outputs.tag_exists == 'false' run: git tag v1.0.0 # Replace with your desired tag name - name: Push Tag - run: git push --tags + if: steps.check_tag.outputs.tag_exists == 'false' + env: + PAT_TOKEN: ${{ secrets.PAT_TOKEN }} + run: | + git remote set-url origin https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository }}.git + git push --tags - - name: Create Release + - name: Create or Update Release id: create_release uses: actions/create-release@v1 env: @@ -32,4 +51,13 @@ jobs: Release notes for v1.0.0 - Feature 1 implemented - Bug fixes + continue-on-error: true + - name: Update Existing Release + if: failure() + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + RELEASE_ID=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/tags/v1.0.0 | jq -r '.id') + curl -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID \ + -d '{"tag_name": "v1.0.0", "name": "Release v1.0.0", "body": "Release notes for v1.0.0\n- Feature 1 implemented\n- Bug fixes"}' From b4d2644a2238236abbdcd2503bfe1a60c27f5661 Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 21:45:05 +0100 Subject: [PATCH 18/21] workflow: modified --- .github/workflows/release.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e0e1b9..b057f23 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,22 +17,36 @@ jobs: git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - - name: Check if tag exists - id: check_tag + - name: Check if tag exists locally + id: check_tag_local run: | if git rev-parse v1.0.0 >/dev/null 2>&1 then - echo "::set-output name=tag_exists::true" + echo "Tag exists locally" + echo "::set-output name=tag_exists_local::true" else - echo "::set-output name=tag_exists::false" + echo "Tag does not exist locally" + echo "::set-output name=tag_exists_local::false" + fi + + - name: Check if tag exists remotely + id: check_tag_remote + run: | + if git ls-remote --tags origin | grep refs/tags/v1.0.0 >/dev/null 2>&1 + then + echo "Tag exists remotely" + echo "::set-output name=tag_exists_remote::true" + else + echo "Tag does not exist remotely" + echo "::set-output name=tag_exists_remote::false" fi - name: Create Tag - if: steps.check_tag.outputs.tag_exists == 'false' + if: steps.check_tag_local.outputs.tag_exists_local == 'false' && steps.check_tag_remote.outputs.tag_exists_remote == 'false' run: git tag v1.0.0 # Replace with your desired tag name - name: Push Tag - if: steps.check_tag.outputs.tag_exists == 'false' + if: steps.check_tag_local.outputs.tag_exists_local == 'false' && steps.check_tag_remote.outputs.tag_exists_remote == 'false' env: PAT_TOKEN: ${{ secrets.PAT_TOKEN }} run: | From 8cc3cbe5ab5495c949450019924682674594c56a Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 21:50:43 +0100 Subject: [PATCH 19/21] workflow: modified --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b057f23..8c05bcd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,8 @@ jobs: body: | Release notes for v1.0.0 - Feature 1 implemented - - Bug fixes + - Basic feature to input text in the text field + - Select Langauge and click the translate button to get the translated text continue-on-error: true - name: Update Existing Release From 1d42c84f58d89711b348d2cb3c68f1974346af7a Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 23:15:22 +0100 Subject: [PATCH 20/21] Readme: Modified README.md file with instructions on how to use and install --- README.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bbb8158..4d2e4fe 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,50 @@ # language_translator_extension -A web browser extension which can be used to translate from one language to another and supports speech recognition be it as input and output +A web browser extension which as of now can be used to translate from one language to another. It supports four languages currenty French, English , German and Spanish. You simply copy text which you want to translate, paste it into the text area , selct your langaue and click the traslate button. + +It uses [Libre Translate](https://hub.docker.com/r/libretranslate/libretranslate) an open source project to handle the transaltions . This translation engine is sef hosted on AWS as an EC2 instance which can be accessed publicly. + +## Steps To Test and Use Plugin With Chrome Browser + +Welcome to the Language Translator Extension! This extension allows you to easily translate text within your browser. + +## Installation Guide + +Follow these steps to install the Language Translator Extension on Google Chrome. + +### Step 1: Download the Extension + +1. Navigate to the [Releases](https://github.com/forkimenjeckayang/language_translator_extension/releases/tag/v1.0.0) page of this repository. +2. Download the latest release ZIP file(*Source code(zip)*). +3. Extract the contents of the ZIP file to a directory on your computer. + +### Step 2: Load the Extension in Chrome + +1. Open Google Chrome. +2. Go to the Extensions page by entering `chrome://extensions/` in the address bar. +3. Enable **Developer mode** by toggling the switch in the top right corner. +4. Click the **Load unpacked** button that appears. +5. In the dialog that opens, navigate to the directory where you extracted the extension files, and select the folder containing the `manifest.json` file.Use the directory which came from the unzipped extension + +### Step 3: Using the Extension + +1. Once the extension is loaded, pin it and you should see its icon appear in the Chrome toolbar. +2. Click the extension icon to open the Language Translator. +3. You can now transalte by putting text in input field, select your langauage and translate. + +## Troubleshooting + +If you encounter any issues while installing or using the extension, please follow these steps: + +1. Make sure you have downloaded and extracted the files correctly. +2. Ensure that you have selected the correct folder containing the `manifest.json` file when loading the unpacked extension. +3. Check that **Developer mode** is enabled in Chrome. + +If you continue to experience problems, feel free to open an issue on the [GitHub repository](https://github.com/forkimenjeckayang/language_translator_extension/issues). + +## Contributing + +We welcome contributions to the Language Translator Extension! Please see our [Contributing Guidelines](CONTRIBUTING.md) for more details. + +Thank you for using the Language Translator Extension! If you find it useful, please consider starring the repository and sharing it with others. + From b9b6f44ef35b6854021b3cb6a1a3eb6f2ec2f33e Mon Sep 17 00:00:00 2001 From: forkimenjeckayang Date: Wed, 12 Jun 2024 23:18:40 +0100 Subject: [PATCH 21/21] Contributions: Contribution guide lines --- CONTRIBUTING.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e81e116 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,72 @@ +# Contributing to Language Translator Extension + +First off, thank you for considering contributing to the Language Translator Extension! Your contributions help make this project better for everyone. + +## How to Contribute + +### Reporting Issues + +If you find a bug or have a feature request, please create an issue in the [GitHub issue tracker](https://github.com/forkimenjeckayang/language_translator_extension/issues). Before submitting a new issue, please check if it has already been reported. + +### Submitting Pull Requests + +1. **Fork the Repository:** + - Navigate to the [repository on GitHub](https://github.com/forkimenjeckayang/language_translator_extension) and click the "Fork" button to create your own copy of the repository. + +2. **Clone the Repository:** + - Clone your fork to your local machine(https): + ```sh + git clone https://github.com/forkimenjeckayang/language_translator_extension.git + ``` + - Clone your fork to your local machine(ssh): + ```sh + git clone git@github.com:forkimenjeckayang/language_translator_extension.git + ``` + +3. **Create a Branch:** + - Create a new branch for your feature or bug fix: + ```sh + git checkout -b my-feature-branch + ``` + +4. **Make Changes:** + - Make your changes in the new branch. Please follow the existing code style and conventions. + +5. **Commit Changes:** + - Commit your changes with a clear and descriptive commit message(Signed commits): + ```sh + git commit -S -m "Add detailed description of what this commit does" + ``` + +6. **Push Changes:** + - Push your changes to your forked repository: + ```sh + git push origin my-feature-branch + ``` + +7. **Create a Pull Request:** + - Go to the original repository on GitHub and click the "New Pull Request" button. + - Select your feature branch and submit the pull request. + - Provide a clear description of the changes you made and any additional information that might be helpful. + +### Code Style + +Please follow these guidelines to maintain a consistent code style: + +- Use meaningful variable and function names. +- Write clear and concise comments where necessary. +- Format your code using the project's existing conventions (e.g., indentation, spacing). + + +### Documentation + +If your changes affect the usage or functionality of the extension, please update the relevant documentation in the `README.md` file or create new documentation as necessary. + + +## Getting Help + +If you need help with anything, feel free to open an issue or reach out by commenting on an existing issue or pull request. + +--- + +Thank you for contributing to the Language Translator Extension! Your efforts are greatly appreciated.