Skip to content

Commit

Permalink
👷 Auto release
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierLDff committed Nov 3, 2020
1 parent 279762c commit 2c09e62
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 11 deletions.
76 changes: 68 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- master
- ci

release:
types:
- created

pull_request:
branches:
- master
Expand All @@ -30,13 +34,29 @@ jobs:
- name: 🚀 Deploy QaterialGallery AppImage
run: docker run --rm -v $(pwd):/src/ --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined reivilo1234/qt-linux-cmake:qt5.15.1-gcc7 cmake --build build --target "QaterialGalleryAppImage" --config "Release" -j $(nproc)

- name: Get Name of Artifact
run: |
ARTIFACT_PATHNAME=$(ls build/*.AppImage | head -n 1)
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME)
echo ::set-env name=ARTIFACT_NAME::${ARTIFACT_NAME}
echo ::set-env name=ARTIFACT_PATHNAME::${ARTIFACT_PATHNAME}
- name: 📦 Upload QaterialGallery AppImage
uses: actions/upload-artifact@v2
with:
name: QaterialGallery.AppImage
path: build/*.AppImage
path: ${{ env.ARTIFACT_PATHNAME }}

if: startsWith(github.ref, 'refs/tags/v')
- name: 🚀 Upload Release Asset
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ARTIFACT_PATHNAME }}
asset_name: QaterialGallery.AppImage
asset_content_type: application/vnd.appimage

BuildApk:

Expand Down Expand Up @@ -119,6 +139,17 @@ jobs:
name: QaterialGallery-${{ matrix.abi }}-${{ matrix.target-api }}.apk
path: build/QaterialGallery-${{ matrix.abi }}/build/outputs/apk/release/QaterialGallery-${{matrix.abi}}-release-signed.apk

- name: 🚀 Upload Release Asset
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/QaterialGallery-${{ matrix.abi }}/build/outputs/apk/release/QaterialGallery-${{matrix.abi}}-release-signed.apk
asset_name: QaterialGallery-${{ matrix.abi }}-${{ matrix.target-api }}.apk
asset_content_type: application/zip

BuildIpa:

runs-on: macOS-latest
Expand Down Expand Up @@ -206,14 +237,34 @@ jobs:
- name: 📦 Upload QaterialGallery Ipa
uses: actions/upload-artifact@v2
with:
name: QaterialGallery-${{ matrix.platform }}-${{ matrix.deployment-target }}.ipa
name: QaterialGallery-i${{ matrix.platform }}-${{ matrix.deployment-target }}.ipa
path: build/QaterialGallery.ipa/Qaterial.ipa

- uses: Apple-Actions/upload-testflight-build@master
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
name: 🚀 Release to TestFlight
with:
app-path: build/QaterialGallery.ipa/Qaterial.ipa
issuer-id: ${{ secrets.IOS_APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.IOS_APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.IOS_APPSTORE_PRIVATE_KEY }}

- name: 🚀 Upload Release Asset
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/QaterialGallery.ipa/Qaterial.ipa
asset_name: QaterialGallery-i${{ matrix.platform }}-${{ matrix.deployment-target }}.ipa
asset_content_type: application/zip

BuildWindows:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macOS-latest]
os: [windows-latest]
version: ['5.15.1']
build-type: ['Release']
steps:
Expand Down Expand Up @@ -255,14 +306,23 @@ jobs:

- name: 🔨 Build QaterialGallery Installer
run: cmake --build build --target "QaterialGalleryInstallerX64" --config "${{ matrix.build-type }}" -j
if: contains(matrix.os, 'windows')

- name: 📦 Upload QaterialGallery Installer
uses: actions/upload-artifact@v2
with:
name: Qaterial Gallery Installer Windows (${{ matrix.version }})
path: build/QaterialGalleryInstaller*.exe
if: contains(matrix.os, 'windows')
name: Qaterial Gallery Installer Windows
path: build/QaterialGalleryInstallerX64${{ matrix.build-type }}.exe

- name: 🚀 Upload Release Asset
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/QaterialGalleryInstallerX64${{ matrix.build-type }}.exe
asset_name: QaterialGalleryInstallerX64${{ matrix.build-type }}.exe
asset_content_type: application/vnd.microsoft.portable-executable

BuildWasm:
runs-on: ubuntu-latest
Expand Down
5 changes: 2 additions & 3 deletions platforms/Deploy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Android")

add_qt_android_apk(${QATERIALGALLERY_TARGET}Apk ${QATERIALGALLERY_TARGET}
NAME "Qaterial"
VERSION_NAME ${QATERIAL_VERSION}
VERSION_CODE 3 # Must be incremented on each release
PACKAGE_NAME "com.qaterial.gallery"
PACKAGE_SOURCES ${QATERIALGALLERY_PLATFORMS_DIR}/android
Expand All @@ -139,8 +138,8 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
add_qt_ios_app(${QATERIALGALLERY_TARGET}
NAME "Qaterial"
BUNDLE_IDENTIFIER "com.qaterial.gallery"
VERSION ${QATERIAL_VERSION}
LONG_VERSION ${QATERIAL_VERSION}.${QATERIAL_VERSION_TAG}
VERSION ${QATERIALGALLERY_VERSION}
LONG_VERSION ${QATERIALGALLERY_VERSION}.${QATERIALGALLERY_VERSION_TAG}
COPYRIGHT "Copyright Olivier Le Doeuff 2019-2020"
ASSET_DIR "${QATERIALGALLERY_PLATFORMS_DIR}/ios/Assets.xcassets"
LAUNCHSCREEN_STORYBOARD "${QATERIALGALLERY_PLATFORMS_DIR}/ios/LaunchScreen.storyboard"
Expand Down

0 comments on commit 2c09e62

Please sign in to comment.