diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 175afa6..923bd42 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,56 +9,15 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - #os: [ windows-latest, ubuntu-16.04, macos-latest ] - os: [ ubuntu-16.04 ] + os: [ ubuntu-16.04, ubuntu-latest, macos-latest, windows-latest ] + + steps: - - uses: actions/checkout@v1 - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install Qt - uses: jurplel/install-qt-action@v2 - - name: Make GNU - if: matrix.os != 'windows-latest' - working-directory: ./buckshot - run: qmake ; make ; ls -al - shell: bash - - name: Make Windows - if: matrix.os == 'windows-latest' - working-directory: ./buckshot - run: | - dir - qmake - dir - #mingw32-make - #dir - nmake - dir - dir release - - - name: Package Linux Test - if: matrix.os == 'ubuntu-16.04' - run: | - echo "== pwd" - pwd - echo "== ls -al" - ls -al - echo "== ls -al buckshot" - ls -al buckshot - echo " ++ GO TIME ++" - ./package_linux.sh - ls -al buckshot-package-ubuntu - - # EVERYTHING BELOW IS ONLY WHEN VERSION TAGS PUSHED (i.e. tag like "v0.1") - # Good - - name: Package OSX - if: matrix.os == 'macos-latest' - run: | - ./package_mac.sh - pip3 install dmgbuild - dmgbuild -s dmg-settings.json "buckshot" buckshot.dmg - + # I DO NOT LIKE THIS, BUT WE CREATE THE RELEASE BEFORE BUILD IS SUCCESSFUL + # BECAUSE OF SERIOUS LIMITATIONS IN GITHUB ACTIONS - name: Create Release id: create_release - if: startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest' uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -66,25 +25,138 @@ jobs: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} + # SAVE RELEASE URL ARTIFACT SO OTHER PLATFORMS CAN FIND WHERE TO UPLOAD RELEASES + - name: Output Release URL File + if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest' + run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt + - name: Save release URL file for later + if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest' + uses: actions/upload-artifact@v1 + with: + name: release_url + path: release_url.txt + + - uses: actions/checkout@v1 + - uses: ilammy/msvc-dev-cmd@v1 + - uses: jurplel/install-qt-action@v2 + + - name: Make GNU + if: matrix.os != 'windows-latest' + working-directory: ./buckshot + run: | + qmake + make + + # - name: Mac debug + # if: matrix.os == 'macos-latest' + # working-directory: ./buckshot + # run: | + # ls + # ls -al buckshot.app + # ls -al buckshot.app/Contents + # ls -al buckshot.app/Contents/MacOS + + - name: Prep Windows (Ico) + if: matrix.os == 'windows-latest' + shell: bash + run: | + cp assets/icon.ico buckshot + echo "RC_ICONS = icon.ico" >> buckshot.pro + + + - name: Make Windows + if: matrix.os == 'windows-latest' + working-directory: ./buckshot + run: | + qmake + nmake + + + # PACKAGING POST BUILD + - name: Package OSX + if: matrix.os == 'macos-latest' + run: | + ./package_mac.sh + pip3 install dmgbuild + dmgbuild -s dmg-settings.json "buckshot" buckshot.dmg + + - name: Package Linux + if: startsWith(matrix.os, 'ubuntu') + run: | + ./package_linux.sh + + - name: Package Windows + if: matrix.os == 'windows-latest' + working-directory: ./buckshot + run: | + mkdir app + cp release\buckshot.exe app + windeployqt app + cp README.md app + $url = "https://github.com/digarok/b2d/releases/download/v1.3/b2d-windows-latest-v1.3.zip" + Invoke-WebRequest -Uri $url -OutFile b2d.zip + 7z.exe x b2d.zip + dir + cp b2d.exe app + $url = "https://github.com/digarok/cadius/releases/download/0.0.0/cadius-windows-latest-0.0.0.zip" + Invoke-WebRequest -Uri $url -OutFile cadius.zip + 7z.exe x cadius.zip + dir + cp build/Src/Debug/Cadius.exe app + + 7z.exe a buckshot.zip app\* + mv buckshot.zip .. + + + # EVERYTHING BELOW IS ONLY WHEN VERSION TAGS PUSHED (i.e. tag like "v0.1") + + + # LOAD THE RELEASE URL FOR ALL PLATFORMS + - name: Load Release URL from artifact + if: startsWith(github.ref, 'refs/tags/v') + uses: actions/download-artifact@v1 + with: + name: release_url + - name: Set upload_url + if: startsWith(github.ref, 'refs/tags/v') + shell: bash + id: release_info + run: | + value=`cat release_url/release_url.txt` + echo ::set-output name=upload_url::$value + + # UPLOAD RELEASES - name: Upload Mac Release if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'macos-latest' uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} + upload_url: ${{ steps.release_info.outputs.upload_url }} asset_path: ./buckshot.dmg asset_name: buckshot.dmg asset_content_type: application/octet-stream - name: Upload Ubuntu Latest Release - if: startsWith(github.ref, 'refs/tags/v') && matrix.os == 'ubuntu-16.04' + if: startsWith(github.ref, 'refs/tags/v') && startsWith(matrix.os, 'ubuntu') uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} + upload_url: ${{ steps.release_info.outputs.upload_url }} asset_path: ./buckshot-linux.zip - asset_name: buckshot-linux.zip + asset_name: buckshot-${{ matrix.os }}.zip asset_content_type: application/octet-stream + + - name: Upload Windows Release + if: startsWith(github.ref, 'refs/tags/v') && startsWith(matrix.os, 'windows') + id: upload-release-asset + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.release_info.outputs.upload_url }} + asset_path: ./buckshot.zip + asset_name: buckshot-${{ matrix.os }}.zip + asset_content_type: application/zip \ No newline at end of file diff --git a/assets/buckshot.desktop b/assets/buckshot.desktop index 49c36ba..03fde29 100644 --- a/assets/buckshot.desktop +++ b/assets/buckshot.desktop @@ -6,4 +6,4 @@ Comment=Convert modern image formats to Apple II formats Terminal=false Categories=Utility; Exec=AppRun %F -Icon=buckshot +Icon=buckshot.png diff --git a/assets/icon.ico b/assets/icon.ico new file mode 100644 index 0000000..b743fef Binary files /dev/null and b/assets/icon.ico differ diff --git a/assets/make_ico.sh b/assets/make_ico.sh new file mode 100755 index 0000000..5d09f55 --- /dev/null +++ b/assets/make_ico.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +convert icon16.png icon32.png icon256.png icon.ico + diff --git a/package_mac.sh b/package_mac.sh index 69f5965..d9ada30 100755 --- a/package_mac.sh +++ b/package_mac.sh @@ -12,6 +12,9 @@ ID=${0##*/} echo "${ID}: RUN macdeployqt" macdeployqt $APPBUILDDIR +echo "${ID}: MKDIR PACKAGEDIR" +mkdir -p $PACKAGEDIR + echo "${ID}: COPY APPBUILDDIR -> PACKAGEDIR" cp -r $APPBUILDDIR $PACKAGEDIR