Skip to content

Commit

Permalink
the final commit (hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
EchterAlsFake committed Jun 8, 2024
1 parent c1caf84 commit 2e552a1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 88 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build_cli_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Archive Porn Fetch CLI (Linux_32) build
uses: actions/upload-artifact@v2
with:
name: PornFetch_CLI_Linux_x32
name: PornFetch_Linux_CLI_x32
path: dist/PornFetch_Linux_CLI_x32

create-release:
Expand All @@ -101,7 +101,7 @@ jobs:
- name: Download Linux x32 artifact
uses: actions/download-artifact@v2
with:
name: PornFetch_CLI_Linux_x32
name: PornFetch_Linux_CLI_x32
path: ./artifacts

- name: List artifacts directory
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
- name: Calculate SHA512 for Linux x32
id: sha512_linux_x32
run: |
sha512sum ./artifacts/PornFetch_CLI_Linux_x32 | awk '{ print $1 }' > sha512_linux_x32.txt
sha512sum ./artifacts/PornFetch_Linux_CLI_x32 | awk '{ print $1 }' > sha512_linux_x32.txt
echo "sha512_linux_x32=$(cat sha512_linux_x32.txt)" >> $GITHUB_ENV
- name: Get current release body
Expand Down Expand Up @@ -185,6 +185,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
upload_url: ${{ steps.get_release_url.outputs.upload_url }}
asset_path: ./artifacts/PornFetch_CLI_Linux_x32
asset_path: ./artifacts/PornFetch_Linux_CLI__x32
asset_name: PornFetch_Linux_CLI_x32
asset_content_type: application/gzip
37 changes: 6 additions & 31 deletions .github/workflows/build_cli_windows.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build CLI (Windows x32,x64)
name: Build CLI (Windows x32, x64)

on:
pull_request:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python 3.11 x64
- name: Set up Python 3.11 x32
uses: actions/setup-python@v2
with:
python-version: 3.11
Expand Down Expand Up @@ -126,46 +126,21 @@ jobs:
sha512sum ./artifacts/PornFetch_Windows_CLI_x32.exe | awk '{ print $1 }' > sha512_windows_x32.txt
echo "sha512_windows_x32=$(cat sha512_windows_x32.txt)" >> $GITHUB_ENV
- name: Create GitHub Release
id: create_release
if: steps.check_release.outputs.release_exists == 'false'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
SHA512_WINDOWS_X64: ${{ env.sha512_windows_x64 }}
SHA512_WINDOWS_X32: ${{ env.sha512_windows_x32 }}
with:
tag_name: v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }}
release_name: Automated Release v${{ secrets.VERSION }}-${{ env.GITHUB_SHA_SHORT }}
body: |
This is an automated release generated by the CI/CD pipeline.
SHA512 Checksums:
- PornFetch_Windows_CLI_x64: ${{ env.SHA512_WINDOWS_X64 }}
- PornFetch_Windows_CLI_x32: ${{ env.SHA512_WINDOWS_X32 }}
draft: false
prerelease: true

- name: Get current release body
id: get_release_body
run: |
CURRENT_BODY=$(gh release view v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }} --json body --jq .body || echo "")
echo "CURRENT_BODY<<EOF" >> $GITHUB_ENV
echo "$CURRENT_BODY" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
gh release view v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }} --json body --jq .body > current_body.txt || echo "" > current_body.txt
- name: Append new SHA512 hash to release body
id: append_release_body
run: |
echo "NEW_BODY=${CURRENT_BODY}\n- PornFetch_Windows_x64: ${{ env.sha512_windows_x64 }}" >> $GITHUB_ENV
echo -e "$(cat current_body.txt)\n- PornFetch_Windows_CLI_x64: ${{ env.sha512_windows_x64 }}\n- PornFetch_Windows_CLI_x32: ${{ env.sha512_windows_x32 }}" > new_body.txt
- name: Update GitHub release
run: |
gh release edit v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }} --notes "${NEW_BODY}"
gh release edit v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }} --notes "$(cat new_body.txt)"
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
NEW_BODY: ${{ env.NEW_BODY }}
shell: bash

- name: Get Release Upload URL
Expand Down Expand Up @@ -196,4 +171,4 @@ jobs:
upload_url: ${{ steps.get_release_url.outputs.upload_url }}
asset_path: ./artifacts/PornFetch_Windows_CLI_x32.exe
asset_name: PornFetch_Windows_CLI_x32.exe
asset_content_type: application/octet-stream
asset_content_type: application/octet-stream
31 changes: 4 additions & 27 deletions .github/workflows/build_gui_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,44 +100,21 @@ jobs:
sha512sum ./artifacts/main.bin | awk '{ print $1 }' > sha512_linux_x64.txt
echo "sha512_linux_x64=$(cat sha512_linux_x64.txt)" >> $GITHUB_ENV
- name: Create GitHub Release
id: create_release
if: steps.check_release.outputs.release_exists == 'false'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
SHA512_LINUX_X64: ${{ env.sha512_linux_x64 }}
with:
tag_name: v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }}
release_name: Automated Release v${{ secrets.VERSION }}-${{ env.GITHUB_SHA_SHORT }}
body: |
This is an automated release generated by the CI/CD pipeline.
SHA512 Checksums:
- PornFetch_GUI_Linux_x64: ${{ env.SHA512_LINUX_X64 }}
draft: false
prerelease: true

- name: Get current release body
id: get_release_body
run: |
CURRENT_BODY=$(gh release view v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }} --json body --jq .body || echo "")
echo "CURRENT_BODY<<EOF" >> $GITHUB_ENV
echo "$CURRENT_BODY" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
gh release view v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }} --json body --jq .body > current_body.txt || echo "" > current_body.txt
- name: Append new SHA512 hash to release body
id: append_release_body
run: |
echo "NEW_BODY=${CURRENT_BODY}\n- PornFetch_Windows_x64: ${{ env.sha512_windows_x64 }}" >> $GITHUB_ENV
echo -e "$(cat current_body.txt)\n- PornFetch_GUI_Linux_x64: ${{ env.sha512_linux_x64 }}" > new_body.txt
- name: Update GitHub release
run: |
gh release edit v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }} --notes "${NEW_BODY}"
gh release edit v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }} --notes "$(cat new_body.txt)"
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
NEW_BODY: ${{ env.NEW_BODY }}
shell: bash

- name: Get Release Upload URL
Expand All @@ -158,4 +135,4 @@ jobs:
upload_url: ${{ steps.get_release_url.outputs.upload_url }}
asset_path: ./artifacts/main.bin
asset_name: PornFetch_GUI_Linux_x64.bin
asset_content_type: application/octet-stream
asset_content_type: application/octet-stream
29 changes: 3 additions & 26 deletions .github/workflows/build_gui_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,44 +97,21 @@ jobs:
sha512sum ./artifacts/main.exe | awk '{ print $1 }' > sha512_windows_x64.txt
echo "sha512_windows_x64=$(cat sha512_windows_x64.txt)" >> $GITHUB_ENV
- name: Create GitHub Release
id: create_release
if: steps.check_release.outputs.release_exists == 'false'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
SHA512_WINDOWS_X64: ${{ env.sha512_windows_x64 }}
with:
tag_name: v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }}
release_name: Automated Release v${{ secrets.VERSION }}-${{ env.GITHUB_SHA_SHORT }}
body: |
This is an automated release generated by the CI/CD pipeline.
SHA512 Checksums:
- PornFetch_GUI_Windows_x64: ${{ env.SHA512_WINDOWS_X64 }}
draft: false
prerelease: true

- name: Get current release body
id: get_release_body
run: |
CURRENT_BODY=$(gh release view v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }} --json body --jq .body || echo "")
echo "CURRENT_BODY<<EOF" >> $GITHUB_ENV
echo "$CURRENT_BODY" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
gh release view v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }} --json body --jq .body > current_body.txt || echo "" > current_body.txt
- name: Append new SHA512 hash to release body
id: append_release_body
run: |
echo "NEW_BODY=${CURRENT_BODY}\n- PornFetch_Windows_x64: ${{ env.sha512_windows_x64 }}" >> $GITHUB_ENV
echo -e "$(cat current_body.txt)\n- PornFetch_GUI_Windows_x64: ${{ env.sha512_windows_x64 }}" > new_body.txt
- name: Update GitHub release
run: |
gh release edit v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }} --notes "${NEW_BODY}"
gh release edit v${{ secrets.VERSION }}-automated-${{ env.GITHUB_SHA_SHORT }} --notes "$(cat new_body.txt)"
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
NEW_BODY: ${{ env.NEW_BODY }}
shell: bash

- name: Get Release Upload URL
Expand Down

0 comments on commit 2e552a1

Please sign in to comment.