Skip to content

Commit

Permalink
upgrade ci config
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlaster committed Dec 24, 2021
1 parent 55d5e54 commit d3e2425
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 176 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Android CI

on:
push:
tags:
- '**'
branches:
- master
- develop
Expand Down Expand Up @@ -132,72 +130,3 @@ jobs:
with:
name: test-results-${{ matrix.api-level }}-${{ matrix.target }}
path: "**/build/outputs/**/connected/**/*.xml"

release :
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [build, unit-test, connected-test]
timeout-minutes: 30

steps:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17

- name: Set up Android SDK License
run: yes | /usr/local/lib/android/sdk/tools/bin/sdkmanager --licenses

- name: Apply Signing
env:
ALIAS: ${{ secrets.ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
run: ./.github/apply_signing.sh

- name: Build with Gradle
run: ./gradlew :android:assembleRelease :android:bundleRelease

- name: Check if is prelease
if: startsWith(github.ref, 'refs/tags/')
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+\-(dev|beta)[0-9]+$ ]]; then
echo ::set-output name=prelease::true
fi
- name: Create Prerelease
if: steps.check-tag.outputs.prelease == 'true'
run: |
set -x
assets=()
for asset in $(find -name *-release.apk); do
assets+=("-a" "$asset")
done
for asset in $(find -name *-release.aab); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name" -p
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
if: steps.check-tag.outputs.prelease != 'true'
run: |
set -x
assets=()
for asset in $(find -name *-release.apk); do
assets+=("-a" "$asset")
done
for asset in $(find -name *-release.aab); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105 changes: 0 additions & 105 deletions .github/workflows/desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Desktop CI

on:
push:
tags:
- '**'
branches:
- master
- develop
Expand Down Expand Up @@ -38,40 +36,6 @@ jobs:
name: build-binaries-ubuntu
path: '**/build/compose/binaries'

- name: Check if is prelease
if: startsWith(github.ref, 'refs/tags/')
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+\-(dev|beta)[0-9]+$ ]]; then
echo ::set-output name=prelease::true
fi
- name: Create Prerelease
if: startsWith(github.ref, 'refs/tags/') && steps.check-tag.outputs.prelease == 'true'
run: |
set -x
assets=()
for asset in $(find -name *.deb); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name" -p
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
if: startsWith(github.ref, 'refs/tags/') && steps.check-tag.outputs.prelease != 'true'
run: |
set -x
assets=()
for asset in $(find -name *.deb); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-windows:
runs-on: windows-latest
timeout-minutes: 30
Expand All @@ -92,40 +56,6 @@ jobs:
name: build-binaries-windows
path: '**/build/compose/binaries'

- name: Check if is prelease
if: startsWith(github.ref, 'refs/tags/')
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+\-(dev|beta)[0-9]+$ ]]; then
echo ::set-output name=prelease::true
fi
- name: Create Prerelease
if: startsWith(github.ref, 'refs/tags/') && steps.check-tag.outputs.prelease == 'true'
run: |
set -x
assets=()
for asset in $(find -name *.msi); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name" -p
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
if: startsWith(github.ref, 'refs/tags/') && steps.check-tag.outputs.prelease != 'true'
run: |
set -x
assets=()
for asset in $(find -name *.msi); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-macos:
runs-on: macos-latest
timeout-minutes: 30
Expand All @@ -145,38 +75,3 @@ jobs:
with:
name: build-binaries-macos
path: '**/build/compose/binaries'

- name: Check if is prelease
if: startsWith(github.ref, 'refs/tags/')
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+\-(dev|beta)[0-9]+$ ]]; then
echo ::set-output name=prelease::true
fi
- name: Create Prerelease
if: startsWith(github.ref, 'refs/tags/') && steps.check-tag.outputs.prelease == 'true'
run: |
set -x
assets=()
for asset in $(find -name *.Dmg); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name" -p
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
if: startsWith(github.ref, 'refs/tags/') && steps.check-tag.outputs.prelease != 'true'
run: |
set -x
assets=()
for asset in $(find -name *.Dmg); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

167 changes: 167 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
name: Release CI

on:
push:
tags:
- '**'

jobs:
release-android:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17

- name: Set up Android SDK License
run: yes | /usr/local/lib/android/sdk/tools/bin/sdkmanager --licenses

- name: Apply Signing
env:
ALIAS: ${{ secrets.ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
run: ./.github/apply_signing.sh

- name: Build with Gradle
run: ./gradlew :android:assembleRelease :android:bundleRelease

- name: Archive android artifacts
uses: actions/upload-artifact@v2
with:
name: android-release
path: |
**/*-release.aab
**/*-release.apk
release-windows:
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17

- name: Build with Gradle
run: ./gradlew :desktop:packageMsi

- name: Archive windows artifacts
uses: actions/upload-artifact@v2
with:
name: windows-release
path: "**/*.msi"

release-macos:
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17

- name: Build with Gradle
run: ./gradlew :desktop:packageDmg

- name: Archive macos artifacts
uses: actions/upload-artifact@v2
with:
name: macos-release
path: "**/*.dmg"

release-linux:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17

- name: Build with Gradle
run: ./gradlew :desktop:packageDeb

- name: Archive linux artifacts
uses: actions/upload-artifact@v2
with:
name: linux-release
path: "**/*.deb"

upload-release:
runs-on: ubuntu-latest
needs: [release-android, release-linux, release-macos, release-windows]
timeout-minutes: 30
steps:
- uses: actions/download-artifact@v2

- name: Check if is prelease
if: startsWith(github.ref, 'refs/tags/')
id: check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+\-(dev|beta)[0-9]+$ ]]; then
echo ::set-output name=prelease::true
fi
- name: Create Prerelease
if: startsWith(github.ref, 'refs/tags/') && steps.check-tag.outputs.prelease == 'true'
run: |
set -x
assets=()
for asset in $(find -name *.deb); do
assets+=("-a" "$asset")
done
for asset in $(find -name *.msi); do
assets+=("-a" "$asset")
done
for asset in $(find -name *.dmg); do
assets+=("-a" "$asset")
done
for asset in $(find -name *.apk); do
assets+=("-a" "$asset")
done
for asset in $(find -name *.aab); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name" -p
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
if: startsWith(github.ref, 'refs/tags/') && steps.check-tag.outputs.prelease != 'true'
run: |
set -x
assets=()
for asset in $(find -name *.deb); do
assets+=("-a" "$asset")
done
for asset in $(find -name *.msi); do
assets+=("-a" "$asset")
done
for asset in $(find -name *.dmg); do
assets+=("-a" "$asset")
done
for asset in $(find -name *.apk); do
assets+=("-a" "$asset")
done
for asset in $(find -name *.aab); do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d3e2425

Please sign in to comment.