Skip to content

Commit

Permalink
Generate official releases with Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Nov 18, 2020
1 parent f3d04dd commit e5261b3
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ deploy:
secure: mUYQ72KBJUaYr5Bhy2HkBkEY13Q7k27Q7IRmOGXfTOq7YnXUS9PikETcZvzCfiVu
on:
APPVEYOR_REPO_TAG: true
DEPLOY: 1
NEVER_TRUE: 1
23 changes: 18 additions & 5 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ jobs:
runs-on: ubuntu-18.04

env:
GRABBER_VERSION: nightly
GRABBER_IS_NIGHTLY: 1
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
PLATFORM_NAME: x64

steps:
- name: Set environment
run: |
echo "GRABBER_VERSION=$([ "$IS_RELEASE" = "true" ] && echo "${GITHUB_REF##*/}" || echo "nightly")" >> $GITHUB_ENV
echo "GRABBER_IS_NIGHTLY=$([ "$IS_RELEASE" = "true" ] && echo "0" || echo "1")" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v1
with:
Expand Down Expand Up @@ -75,17 +79,17 @@ jobs:
- name: Generate package
run: |
mv build/gui-qml/gui-qml-armeabi-v7a/build/outputs/apk/release/gui-qml-armeabi-v7a-release-signed.apk Grabber_nightly.apk
mv build/gui-qml/gui-qml-armeabi-v7a/build/outputs/apk/release/gui-qml-armeabi-v7a-release-signed.apk Grabber_${GRABBER_VERSION}.apk
ls -la *.apk
- name: Get date for Nightly body
id: date
if: ${{ github.event_name != 'pull_request' }}
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/v') }}
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S %Z')"

- name: Nightly
uses: ncipollo/release-action@v1
if: ${{ github.event_name != 'pull_request' }}
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/v') }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: nightly-github
Expand All @@ -100,3 +104,12 @@ jobs:
**Head:** ${{ github.sha }}
**Date:** ${{ steps.date.outputs.date }}
- name: Release
uses: ncipollo/release-action@v1
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
draft: true
artifacts: Grabber_*.apk
21 changes: 17 additions & 4 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ jobs:
runs-on: ubuntu-16.04

env:
GRABBER_VERSION: nightly
GRABBER_IS_NIGHTLY: 1
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
PLATFORM_NAME: x64

steps:
- name: Set environment
run: |
echo "GRABBER_VERSION=$([ "$IS_RELEASE" = "true" ] && echo "${GITHUB_REF##*/}" || echo "nightly")" >> $GITHUB_ENV
echo "GRABBER_IS_NIGHTLY=$([ "$IS_RELEASE" = "true" ] && echo "0" || echo "1")" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v1
with:
Expand Down Expand Up @@ -75,12 +79,12 @@ jobs:

- name: Get date for Nightly body
id: date
if: ${{ github.event_name != 'pull_request' }}
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/v') }}
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S %Z')"

- name: Nightly
uses: ncipollo/release-action@v1
if: ${{ github.event_name != 'pull_request' }}
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/v') }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: nightly-github
Expand All @@ -95,3 +99,12 @@ jobs:
**Head:** ${{ github.sha }}
**Date:** ${{ steps.date.outputs.date }}
- name: Release
uses: ncipollo/release-action@v1
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
draft: true
artifacts: Grabber_*.AppImage
25 changes: 19 additions & 6 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ jobs:
runs-on: macos-10.15

env:
GRABBER_VERSION: nightly
GRABBER_IS_NIGHTLY: 1
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
PLATFORM_NAME: x64
OPENSSL_ROOT_DIR: /usr/local/opt/openssl/

steps:
- name: Set environment
run: |
echo "GRABBER_VERSION=$([ "$IS_RELEASE" = "true" ] && echo "${GITHUB_REF##*/}" || echo "nightly")" >> $GITHUB_ENV
echo "GRABBER_IS_NIGHTLY=$([ "$IS_RELEASE" = "true" ] && echo "0" || echo "1")" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v1
with:
Expand All @@ -36,7 +40,7 @@ jobs:

- name: Configure
working-directory: build
run: cmake ../src -DCMAKE_BUILD_TYPE=Release -DNIGHTLY=%GRABBER_IS_NIGHTLY% -DCOMMIT="%GITHUB_SHA%" -DVERSION="%GRABBER_VERSION%"
run: cmake ../src -DCMAKE_BUILD_TYPE=Release -DNIGHTLY=$GRABBER_IS_NIGHTLY -DCOMMIT="$GITHUB_SHA" -DVERSION="$GRABBER_VERSION"

- name: Compile
working-directory: build
Expand All @@ -51,16 +55,16 @@ jobs:
- name: Generate package
run: |
./scripts/package-mac.sh
mv Grabber.dmg Grabber_nightly.dmg
mv Grabber.dmg Grabber_${GRABBER_VERSION}.dmg
- name: Get date for Nightly body
id: date
if: ${{ github.event_name != 'pull_request' }}
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/v') }}
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S %Z')"

- name: Nightly
uses: ncipollo/release-action@v1
if: ${{ github.event_name != 'pull_request' }}
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/v') }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: nightly-github
Expand All @@ -75,3 +79,12 @@ jobs:
**Head:** ${{ github.sha }}
**Date:** ${{ steps.date.outputs.date }}
- name: Release
uses: ncipollo/release-action@v1
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
draft: true
artifacts: Grabber_*.dmg
22 changes: 18 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ jobs:
platform: [x86, x64]

env:
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
MYSQL_DRIVER_URL: https://github.com/thecodemonkey86/qt_mysql_driver/files/5198020/qsqlmysql.dll_Qt_SQL_driver_5.15.1_MSVC2019_64-Bit.zip
QSCINTILLA_VERSION: QScintilla_gpl-2.10.8
GRABBER_VERSION: nightly
GRABBER_IS_NIGHTLY: 1
OPENSSL_ROOT_DIR: ${{ github.workspace }}\vendor\OpenSSL
MYSQL_DRIVER_DIR: ${{ github.workspace }}\vendor\MySQL_driver
APNG_PLUGIN_DLL: ${{ github.workspace }}\vendor\APNG\plugins\imageformats\qapng.dll

steps:
- name: Set environment
shell: bash
run: |
echo "GRABBER_VERSION=$([ "$IS_RELEASE" = "true" ] && echo "${GITHUB_REF##*/}" || echo "nightly")" >> $GITHUB_ENV
echo "GRABBER_IS_NIGHTLY=$([ "$IS_RELEASE" = "true" ] && echo "0" || echo "1")" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v1
with:
Expand Down Expand Up @@ -156,12 +161,12 @@ jobs:
- name: Get date for Nightly body
id: date
if: ${{ github.event_name != 'pull_request' }}
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/v') }}
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S %Z')"

- name: Nightly
uses: ncipollo/release-action@v1
if: ${{ github.event_name != 'pull_request' }}
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/tags/v') }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: nightly-github
Expand All @@ -176,3 +181,12 @@ jobs:
**Head:** ${{ github.sha }}
**Date:** ${{ steps.date.outputs.date }}
- name: Release
uses: ncipollo/release-action@v1
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
draft: true
artifacts: scripts\windows-setup\Grabber_*.exe
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ deploy:
repo: Bionus/imgbrd-grabber
branch: master
tags: true
condition: $PACKAGE == 1
condition: $NEVER_TRUE == 1

0 comments on commit e5261b3

Please sign in to comment.