From b1ec69df93553f19d758b8987a7cbe1ebf8a2929 Mon Sep 17 00:00:00 2001 From: Ankit S Date: Sun, 23 Oct 2022 14:45:14 +0530 Subject: [PATCH 1/4] Automate github release using actions * New release will be created whenever a git tag similar to `v*` pattern is pushed * Release body will contain the tag message and a link to full changelog since last release --- .github/workflows/release.yaml | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..a6b4b6b --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,55 @@ +name: Github Release + +# Controls when the workflow will run +on: + push: + tags: + - v** + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: windows-latest + defaults: + run: + shell: bash + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v3 + + - name: Set Env + run: | + git fetch --tags -f + GIT_TAG=${GITHUB_REF#refs/*/} + echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV + + # Using file to support multi-line body + git tag -l --format='%(contents)' $GIT_TAG >> tag.txt + cat tag.txt + + - uses: actions/setup-python@v4 + with: + python-version: 3.10 + - run: | + pip3 install -r requirements.txt pyinstaller + pyinstaller main.spec + + - name: Create Github Release + uses: ncipollo/release-action@v1 + with: + bodyFile: tag.txt + name: "Amegma Galaxy Attack ${{ env.GIT_TAG }}" + artifacts: dist/main.exe + generateReleaseNotes: true + + - name: Save APK to Artifacts + uses: actions/upload-artifact@v2 + with: + name: APK + path: dist/main.exe \ No newline at end of file From 14800a73c86c6978e8c6671a5c709f2230fca7e6 Mon Sep 17 00:00:00 2001 From: Ankit S Date: Tue, 25 Oct 2022 13:19:46 +0530 Subject: [PATCH 2/4] Triggering github actions on manual release --- .github/workflows/release.yaml | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a6b4b6b..34fddd3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,9 +2,8 @@ name: Github Release # Controls when the workflow will run on: - push: - tags: - - v** + release: + types: [published] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -12,7 +11,7 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" - build: + release: # The type of runner that the job will run on runs-on: windows-latest defaults: @@ -23,19 +22,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set Env - run: | - git fetch --tags -f - GIT_TAG=${GITHUB_REF#refs/*/} - echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV - - # Using file to support multi-line body - git tag -l --format='%(contents)' $GIT_TAG >> tag.txt - cat tag.txt - - uses: actions/setup-python@v4 with: python-version: 3.10 + cache: 'pip' - run: | pip3 install -r requirements.txt pyinstaller pyinstaller main.spec @@ -43,10 +33,12 @@ jobs: - name: Create Github Release uses: ncipollo/release-action@v1 with: - bodyFile: tag.txt - name: "Amegma Galaxy Attack ${{ env.GIT_TAG }}" artifacts: dist/main.exe - generateReleaseNotes: true + allowUpdates: true + omitBodyDuringUpdate: true + omitDraftDuringUpdate: true + omitNameDuringUpdate: true + omitPrereleaseDuringUpdate: true - name: Save APK to Artifacts uses: actions/upload-artifact@v2 From ec4fd14d87dd37db5fb1bd4b44573909bc662a83 Mon Sep 17 00:00:00 2001 From: Ankit Saini Date: Sun, 11 Dec 2022 11:47:37 +0530 Subject: [PATCH 3/4] chore: Fixing typo --- .github/workflows/release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 34fddd3..0b8e5c5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -40,8 +40,8 @@ jobs: omitNameDuringUpdate: true omitPrereleaseDuringUpdate: true - - name: Save APK to Artifacts + - name: Save EXE to Artifacts uses: actions/upload-artifact@v2 with: - name: APK - path: dist/main.exe \ No newline at end of file + name: EXE + path: dist/main.exe From c91f87654656e379795fbbdf22c56503f5ebc828 Mon Sep 17 00:00:00 2001 From: Ankit Saini Date: Sun, 11 Dec 2022 14:11:39 +0530 Subject: [PATCH 4/4] chore: maintain support for older python versions --- models/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/db.py b/models/db.py index e9244d5..bc1cd28 100644 --- a/models/db.py +++ b/models/db.py @@ -9,7 +9,7 @@ class Db: - def __init__(self, file_path: Path | str) -> None: + def __init__(self, file_path: 'Path | str') -> None: self.con = sqlite3.connect(file_path) self._init_db()