Skip to content

Commit

Permalink
ich geh erst schlafen, wenn der scheiß funktioniert
Browse files Browse the repository at this point in the history
  • Loading branch information
EchterAlsFake committed Jun 7, 2024
1 parent 2fcbed5 commit 6a0f78a
Showing 1 changed file with 13 additions and 24 deletions.
37 changes: 13 additions & 24 deletions .github/workflows/build_cli_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,20 @@ jobs:
path: dist/PornFetch_Linux_CLI_x32

create-release:
needs: [ build-pornfetch-cli-linux-64, build-pornfetch-cli-linux-32 ]
needs: [build-pornfetch-cli-linux-64, build-pornfetch-cli-linux-32]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install gh CLI
run: |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh -y
- name: Download Linux x64 artifact
uses: actions/download-artifact@v2
with:
Expand Down Expand Up @@ -131,28 +139,9 @@ jobs:
- name: Calculate SHA512 for Linux x32
id: sha512_linux_x32
run: |
sha512sum ./artifacts/PornFetch_Linux_CLI_x32 | awk '{ print $1 }' > sha512_linux_x32.txt
sha512sum ./artifacts/PornFetch_CLI_Linux_x32 | awk '{ print $1 }' > sha512_linux_x32.txt
echo "sha512_linux_x32=$(cat sha512_linux_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_LINUX_X64: ${{ env.sha512_linux_x64 }}
SHA512_LINUX_X32: ${{ env.sha512_linux_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_Linux_CLI_x64: ${{ env.SHA512_LINUX_X64 }}
- PornFetch_Linux_CLI_x32: ${{ env.SHA512_LINUX_X32 }}
draft: false
prerelease: true

- name: Get current release body
id: get_release_body
run: |
Expand All @@ -166,7 +155,7 @@ jobs:
- 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 "NEW_BODY=${CURRENT_BODY}\n- PornFetch_Linux_x64: ${{ env.sha512_linux_x64 }}\n- PornFetch_Linux_x32: ${{ env.sha512_linux_x32 }}" >> $GITHUB_ENV
- name: Update GitHub release
run: |
Expand Down Expand Up @@ -202,6 +191,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
upload_url: ${{ steps.get_release_url.outputs.upload_url }}
asset_path: ./artifacts/PornFetch_Linux_CLI_x32
asset_path: ./artifacts/PornFetch_CLI_Linux_x32
asset_name: PornFetch_Linux_CLI_x32
asset_content_type: application/gzip
asset_content_type: application/gzip

0 comments on commit 6a0f78a

Please sign in to comment.