mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dd6d16d833 | |||
| 7d0c8d16ec | |||
| 80750f010f | |||
| c93f6345c8 | |||
| a7132ed1cd | |||
| a2cff15d0d |
+34
-33
@@ -35,6 +35,8 @@ jobs:
|
|||||||
asset_name: SoftwareManager-dev-macos
|
asset_name: SoftwareManager-dev-macos
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.version.outputs.version }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -66,15 +68,35 @@ jobs:
|
|||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install pyinstaller
|
pip install pyinstaller
|
||||||
|
|
||||||
- name: Inject commit hash into code
|
- name: Generate version
|
||||||
|
id: version
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo '{' > build_info.json
|
COMMIT_SHA=${{ github.sha }}
|
||||||
echo " \"version\": \"${GITHUB_SHA}\"" >> build_info.json
|
SHORT_SHA=${COMMIT_SHA:0:7}
|
||||||
echo '}' >> build_info.json
|
VERSION="${SHORT_SHA}-dev"
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
|
||||||
|
echo "Generated version: $VERSION"
|
||||||
|
|
||||||
- name: Build executable with PyInstaller
|
- name: Inject commit hash into code (Windows)
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$json = '{
|
||||||
|
"version": "' + $env:VERSION + '"
|
||||||
|
}'
|
||||||
|
$json | Out-File -Encoding utf8 build_info.json
|
||||||
|
|
||||||
|
- name: Build executable with PyInstaller (Windows)
|
||||||
|
if: runner.os == 'Windows'
|
||||||
run: pyinstaller --onefile --windowed --add-data "build_info.json:." --name ${{ env.APP_NAME }} main.py
|
run: pyinstaller --onefile --windowed --add-data "build_info.json:." --name ${{ env.APP_NAME }} main.py
|
||||||
|
|
||||||
|
- name: Build executable with PyInstaller (Unix)
|
||||||
|
if: runner.os != 'Windows'
|
||||||
|
run: pyinstaller --onefile --windowed --name ${{ env.APP_NAME }} main.py
|
||||||
|
|
||||||
- name: Make executable (Unix)
|
- name: Make executable (Unix)
|
||||||
if: runner.os != 'Windows'
|
if: runner.os != 'Windows'
|
||||||
run: chmod +x dist/${{ env.APP_NAME }}
|
run: chmod +x dist/${{ env.APP_NAME }}
|
||||||
@@ -100,46 +122,25 @@ jobs:
|
|||||||
if: success()
|
if: success()
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- uses: actions/download-artifact@v4
|
||||||
|
|
||||||
- name: Download all artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
path: artifacts
|
path: artifacts
|
||||||
|
|
||||||
- name: Display downloaded artifacts
|
|
||||||
run: |
|
|
||||||
echo "Downloaded artifacts:"
|
|
||||||
find artifacts -type f
|
|
||||||
ls -la artifacts/
|
|
||||||
|
|
||||||
- name: Generate version
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
COMMIT_SHA=${{ github.sha }}
|
|
||||||
SHORT_SHA=${COMMIT_SHA:0:7}
|
|
||||||
VERSION="${SHORT_SHA}-dev"
|
|
||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
||||||
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
|
|
||||||
echo "Generated version: ${VERSION}"
|
|
||||||
|
|
||||||
- name: Prepare release files
|
- name: Prepare release files
|
||||||
run: |
|
run: |
|
||||||
mkdir -p release
|
mkdir -p release
|
||||||
cp artifacts/ubuntu-latest-build/SoftwareManager-dev-linux release/SoftwareManager-dev-linux
|
cp artifacts/ubuntu-latest-build/SoftwareManager-dev-linux release/
|
||||||
cp artifacts/windows-latest-build/SoftwareManager-dev-windows.exe release/SoftwareManager-dev-windows.exe
|
cp artifacts/windows-latest-build/SoftwareManager-dev-windows.exe release/
|
||||||
cp artifacts/macos-latest-build/SoftwareManager-dev-macos release/SoftwareManager-dev-macos
|
cp artifacts/macos-latest-build/SoftwareManager-dev-macos release/
|
||||||
chmod +x release/SoftwareManager-dev-linux release/SoftwareManager-dev-macos
|
chmod +x release/SoftwareManager-dev-linux release/SoftwareManager-dev-macos
|
||||||
ls -la release/
|
ls -la release/
|
||||||
|
|
||||||
- name: Create Release (Public)
|
- name: Create Release (Public)
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ steps.version.outputs.version }}
|
tag_name: ${{ needs.build.outputs.version }}
|
||||||
name: ${{ steps.version.outputs.version }}
|
name: ${{ needs.build.outputs.version }}
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
files: |
|
files: |
|
||||||
release/SoftwareManager-dev-linux
|
release/SoftwareManager-dev-linux
|
||||||
release/SoftwareManager-dev-windows.exe
|
release/SoftwareManager-dev-windows.exe
|
||||||
|
|||||||
Reference in New Issue
Block a user