mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-31 04:32:32 +00:00
chore(ci): build and publish Linux builds to Snapcraft
This commit is contained in:
24
.github/workflows/prepare_build.yml
vendored
24
.github/workflows/prepare_build.yml
vendored
@@ -14,6 +14,9 @@ on:
|
||||
number:
|
||||
description: "Build Number"
|
||||
value: ${{ jobs.number.outputs.output1 }}
|
||||
version:
|
||||
description: "Build Version"
|
||||
value: ${{ jobs.version.outputs.output1 }}
|
||||
|
||||
jobs:
|
||||
flavor:
|
||||
@@ -90,3 +93,24 @@ jobs:
|
||||
run: |
|
||||
echo ${{ steps.script.outputs.result }}
|
||||
echo "::set-output name=number::${{ steps.script.outputs.result }}"
|
||||
|
||||
version:
|
||||
name: Version
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
output1: ${{ steps.output.outputs.number }}
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get Version
|
||||
id: version
|
||||
uses: martinbeentjes/npm-get-version-action@v1.1.0
|
||||
|
||||
- name: Set Output
|
||||
id: output
|
||||
run: |
|
||||
echo ${{ steps.version.outputs.current-version }}
|
||||
echo "::set-output name=number::${{ steps.version.outputs.current-version }}"
|
||||
|
||||
17
.github/workflows/release.yml
vendored
17
.github/workflows/release.yml
vendored
@@ -55,6 +55,7 @@ jobs:
|
||||
with:
|
||||
build_flavor: ${{ needs.prepare_build.outputs.flavor }}
|
||||
build_number: ${{ needs.prepare_build.outputs.number }}
|
||||
build_version: ${{ needs.prepare_build.outputs.version }}
|
||||
secrets:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }}
|
||||
@@ -69,6 +70,7 @@ jobs:
|
||||
with:
|
||||
build_flavor: ${{ needs.prepare_build.outputs.flavor }}
|
||||
build_number: ${{ needs.prepare_build.outputs.number }}
|
||||
build_version: ${{ needs.prepare_build.outputs.version }}
|
||||
secrets:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }}
|
||||
@@ -84,6 +86,19 @@ jobs:
|
||||
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
|
||||
MATCH_SSH_PRIVATE_KEY: ${{ secrets.MATCH_SSH_PRIVATE_KEY }}
|
||||
|
||||
linux:
|
||||
name: Linux
|
||||
needs: [ prepare_build, validate ]
|
||||
uses: JagandeepBrar/LunaSea/.github/workflows/release_linux.yml@master
|
||||
with:
|
||||
build_flavor: ${{ needs.prepare_build.outputs.flavor }}
|
||||
build_number: ${{ needs.prepare_build.outputs.number }}
|
||||
build_version: ${{ needs.prepare_build.outputs.version }}
|
||||
secrets:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }}
|
||||
SNAPCRAFT_TOKEN: ${{ secrets.SNAPCRAFT_TOKEN }}
|
||||
|
||||
macos:
|
||||
name: macOS
|
||||
needs: [ prepare_build, validate ]
|
||||
@@ -91,6 +106,7 @@ jobs:
|
||||
with:
|
||||
build_flavor: ${{ needs.prepare_build.outputs.flavor }}
|
||||
build_number: ${{ needs.prepare_build.outputs.number }}
|
||||
build_version: ${{ needs.prepare_build.outputs.version }}
|
||||
secrets:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }}
|
||||
@@ -113,6 +129,7 @@ jobs:
|
||||
with:
|
||||
build_flavor: ${{ needs.prepare_build.outputs.flavor }}
|
||||
build_number: ${{ needs.prepare_build.outputs.number }}
|
||||
build_version: ${{ needs.prepare_build.outputs.version }}
|
||||
secrets:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }}
|
||||
|
||||
3
.github/workflows/release_android.yml
vendored
3
.github/workflows/release_android.yml
vendored
@@ -9,6 +9,9 @@ on:
|
||||
build_number:
|
||||
required: true
|
||||
type: string
|
||||
build_version:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
secrets:
|
||||
DISCORD_WEBHOOK:
|
||||
|
||||
3
.github/workflows/release_ios.yml
vendored
3
.github/workflows/release_ios.yml
vendored
@@ -9,6 +9,9 @@ on:
|
||||
build_number:
|
||||
required: true
|
||||
type: string
|
||||
build_version:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
secrets:
|
||||
APPLE_ID:
|
||||
|
||||
126
.github/workflows/release_linux.yml
vendored
Normal file
126
.github/workflows/release_linux.yml
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
name: '[Release] Linux'
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
build_flavor:
|
||||
required: true
|
||||
type: string
|
||||
build_number:
|
||||
required: true
|
||||
type: string
|
||||
build_version:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
secrets:
|
||||
DISCORD_WEBHOOK:
|
||||
required: true
|
||||
FIREBASE_OPTIONS:
|
||||
required: true
|
||||
SNAPCRAFT_TOKEN:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Download Source Files
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: lib-${{ github.sha }}
|
||||
path: ${{ github.workspace }}/lib
|
||||
|
||||
- name: Download Localization Files
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: localization-${{ github.sha }}
|
||||
path: ${{ github.workspace }}/assets/localization
|
||||
|
||||
- name: Install Secrets
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
echo ${{ secrets.FIREBASE_OPTIONS }} | base64 --decode > lib/firebase_options.dart
|
||||
|
||||
- name: Install Snapcraft
|
||||
uses: samuelmeuli/action-snapcraft@v1
|
||||
with:
|
||||
use_lxd: true
|
||||
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: stable
|
||||
cache: true
|
||||
cache-key: ${{ github.sha }}
|
||||
|
||||
- name: Setup Flutter
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
flutter pub get
|
||||
|
||||
- name: Build LunaSea
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
sg lxd -c 'snapcraft --use-lxd'
|
||||
|
||||
- name: Upload Snap Build Artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: linux-${{ inputs.build_flavor }}-${{ github.sha }}
|
||||
path: ${{ github.workspace }}/lunasea_${{ inputs.build_version }}_amd64.snap
|
||||
|
||||
- name: Send Discord Message
|
||||
uses: sarisia/actions-status-discord@v1
|
||||
if: always()
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
with:
|
||||
title: '`[${{ inputs.build_flavor }}]` Linux Build'
|
||||
description: linux-${{ inputs.build_flavor }}-${{ github.sha }}
|
||||
|
||||
deploy:
|
||||
name: Deploy
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build ]
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Determine Release Channel
|
||||
id: channel
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
FLAVOR: ${{ inputs.ref }}
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
const ref = process.env.FLAVOR || "edge";
|
||||
switch (ref) {
|
||||
case "beta": return "beta";
|
||||
case "candidate": return "candidate";
|
||||
case "stable": return "stable";
|
||||
case "edge":
|
||||
default: return "edge";
|
||||
}
|
||||
|
||||
- name: Install Snapcraft
|
||||
uses: samuelmeuli/action-snapcraft@v1
|
||||
with:
|
||||
snapcraft_token: ${{ secrets.SNAPCRAFT_TOKEN }}
|
||||
|
||||
- name: Download Snap Build Artifact
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: linux-${{ inputs.build_flavor }}-${{ github.sha }}
|
||||
path: ${{ github.workspace }}
|
||||
|
||||
- name: Deploy to Snapcraft
|
||||
run: |
|
||||
snapcraft upload --release=${{ inputs.build_flavor }} lunasea_${{ inputs.build_version }}_amd64.snap
|
||||
3
.github/workflows/release_macos.yml
vendored
3
.github/workflows/release_macos.yml
vendored
@@ -9,6 +9,9 @@ on:
|
||||
build_number:
|
||||
required: true
|
||||
type: string
|
||||
build_version:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
secrets:
|
||||
APPLE_ID:
|
||||
|
||||
4
.github/workflows/release_web.yml
vendored
4
.github/workflows/release_web.yml
vendored
@@ -9,6 +9,9 @@ on:
|
||||
build_number:
|
||||
required: true
|
||||
type: string
|
||||
build_version:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
secrets:
|
||||
DISCORD_WEBHOOK:
|
||||
@@ -115,4 +118,5 @@ jobs:
|
||||
NETLIFY_SITE_ID: ${{ steps.channel.outputs.result }}
|
||||
with:
|
||||
publish-dir: ${{ github.workspace}}/build/web
|
||||
production-deploy: true
|
||||
deploy-message: ${{ github.sha }}
|
||||
|
||||
Reference in New Issue
Block a user