deskflow/.github/actions/dist-upload/action.yml
Nick Bolton bec38ab47b
Re-implement packaging for GitHub workflows (Windows) (#7360)
* Add new version env vars to example

* Remove test file

* Move CMake packaging to separate module and configure OpenSSL path for Windows

* Make VS Code CMake build task default

* Generate Microsoft-friendly 4-digit version number

* Update macOS bundle .plist with build year variable

* Use correct OpenSSL path and fixed various MSI variables

* Use correct rest/dist dir for MSI

* Add version .rc file for Windows

* Use macro instead of over-complicated version query command

* Made cmd_utils more secure by defaulting to no-shell and no-print

* Add certificate management module

* Implement packaging script on Windows

* Refactor Mac packaging script to use new cmd_utils args and new cert module

* Update ChangeLog

* Change PFX env vars and add to CI

* Use import as instead of from lib to solve resolve issue

* Allow custom certificate extensions

* Check for package version when using gdrive

* Make version number required

* Add missing shell

* Add missing gdrive value in test

* Find OpenSSL dir based on openssl binary

* Only use first OpenSSL entry

* More verbose logging

* Improve logging

* Only use env var if not empty

* Fixed wrong var

* Fixed macOS GitHub artefact name

* Change filename format to match new convention
2024-06-28 09:35:18 +00:00

56 lines
1.7 KiB
YAML

name: "Distribute upload"
description: "Uploads the package from the dist dir to GitHub artifacts or Google Drive"
inputs:
use_github:
description: "Whether to upload to GitHub artifacts"
use_gdrive:
description: "Whether to upload to Google Drive"
github-target-filename:
description: "Filename to upload (GitHub artifacts)"
gdrive-target-base-dir:
description: "Base directory to upload (Google Drive)"
gdrive-secret-key:
description: "Google Drive secret key"
gdrive-parent-folder-id:
description: "Google Drive parent folder ID"
package-version:
description: "Package version appended to the Google Drive dir"
runs:
using: "composite"
steps:
- if: ${{ inputs.use_gdrive == 'true' && !inputs.package-version }}
run: |
echo "Input 'package-version' is required when uploading to Google Drive"
exit 1
shell: bash
- if: ${{ inputs.use_gdrive == 'true' }}
run: |
SHORT_VERSION=$(echo "${{ inputs.package-version }}" | cut -d'-' -f1)
echo "SHORT_VERSION=$SHORT_VERSION" >> $GITHUB_ENV
shell: bash
# Upload to GitHub
- if: ${{ inputs.use_github == 'true' }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.github-target-filename }}
path: ./dist
retention-days: 3
# Upload to Google Drive
- if: ${{ inputs.use_gdrive == 'true' }}
uses: symless/gdrive-upload@target-glob
with:
credentials: ${{ inputs.gdrive-secret-key }}
target: "./dist/*"
parent_folder_id: ${{ inputs.gdrive-parent-folder-id }}
child_folder: Packages/${{ inputs.gdrive-target-base-dir }}/${{ env.SHORT_VERSION }}/${{ inputs.package-version }}