Update workflow

This commit is contained in:
Jakub Melka
2024-07-03 14:09:09 +02:00
parent d9abc64ede
commit 69b917c1a3
3 changed files with 95 additions and 65 deletions

View File

@ -4,12 +4,12 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
fetch-artifacts: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Install tools - name: Install tools
run: | run: |
@ -46,25 +46,63 @@ jobs:
- name: Download Linux_AppImage artifact - name: Download Linux_AppImage artifact
run: | run: |
mkdir -p artifacts/linux mkdir -p artifacts
gh run download ${{ env.linux_run_id }} --name Linux_AppImage -D artifacts/linux/ echo "Downloading artifacts from run ID: ${{ env.linux_run_id }}..."
gh run download ${{ env.linux_run_id }} -D artifacts
echo "Artifacts downloaded to artifacts directory."
env:
GH_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
- name: Download Windows_MSI artifact - name: Download Windows_MSI artifact
run: | run: |
mkdir -p artifacts/windows mkdir -p artifacts
gh run download ${{ env.windows_run_id }} --name Windows_MSI -D artifacts/windows/ echo "Downloading artifacts from run ID: ${{ env.windows_run_id }}..."
gh run download ${{ env.windows_run_id }} -D artifacts
echo "Artifacts downloaded to artifacts directory."
env:
GH_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
- name: Read version
id: get_version
run: |
version=$(grep -oP 'set\(PDF4QT_VERSION \K[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' "CMakeLists.txt")
echo "Version: $version"
echo "pdf4qt_version=$version" >> $GITHUB_ENV
- name: Rezip zip file
id: rezip_zip_file
run: |
cd artifacts/PDF4QT-Windows-${{ env.pdf4qt_version }}.zip
zip -r ../PDF4QT-Windows-${{ env.pdf4qt_version }}.zip.backup *
- name: Rename zip archive
run: |
rm -rf artifacts/PDF4QT-Windows-${{ env.pdf4qt_version }}.zip/
mv artifacts/PDF4QT-Windows-${{ env.pdf4qt_version }}.zip.backup artifacts/PDF4QT-Windows-${{ env.pdf4qt_version }}.zip
- name: Correct file paths
run: |
find artifacts -mindepth 2 -type f -exec sh -c 'mv "$1" "artifacts/$(basename "$1")_moved"' _ {} \;
find artifacts -type d -empty -delete
for f in artifacts/*_moved; do
mv "$f" "${f/_moved/}"
done
- name: List all files recursively
run: |
echo "Listing all files in artifacts:"
find artifacts -type f -print
- name: Create Release Draft - name: Create Release Draft
id: create_release id: create_release
uses: actions/create-release@v1 uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
with: with:
tag_name: '' tag_name: 'v${{ env.pdf4qt_version }}'
release_name: "Release Draft" name: "Release of PDF4QT ${{ env.pdf4qt_version }} (Draft)"
draft: true draft: true
prerelease: false prerelease: false
generate_release_notes: true generate_release_notes: true
token: ${{ secrets.MY_GITHUB_TOKEN }}
fail_on_unmatched_files: true
files: | files: |
artifacts/linux/* artifacts/*
artifacts/windows/*

View File

@ -1,10 +1,6 @@
name: Linux_AppImage name: Linux_AppImage
on: on:
push:
tags:
- 'v*'
workflow_dispatch: workflow_dispatch:
jobs: jobs:

View File

@ -1,10 +1,6 @@
name: Windows_MSI name: Windows_MSI
on: on:
push:
tags:
- 'v*'
workflow_dispatch: workflow_dispatch:
jobs: jobs: