mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-31 12:42:34 +00:00
chore(ci): abstract platform publishing workflows
[platform:web]
This commit is contained in:
2
.github/workflows/build_web.yml
vendored
2
.github/workflows/build_web.yml
vendored
@@ -51,7 +51,7 @@ jobs:
|
||||
with:
|
||||
type: zip
|
||||
filename: output/lunasea-web-canvaskit.zip
|
||||
directory: ${{ github.workspace }}/build/web
|
||||
path: build/web
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
|
||||
377
.github/workflows/publish.yml
vendored
377
.github/workflows/publish.yml
vendored
@@ -1,377 +0,0 @@
|
||||
name: 'Publish Releases'
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
build-title:
|
||||
required: true
|
||||
type: string
|
||||
flavor:
|
||||
required: true
|
||||
type: string
|
||||
enable-android:
|
||||
required: true
|
||||
type: string
|
||||
enable-ios:
|
||||
required: true
|
||||
type: string
|
||||
enable-linux:
|
||||
required: true
|
||||
type: string
|
||||
enable-macos:
|
||||
required: true
|
||||
type: string
|
||||
enable-web:
|
||||
required: true
|
||||
type: string
|
||||
enable-windows:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
secrets:
|
||||
APPLE_ID:
|
||||
required: true
|
||||
APPLE_ITC_TEAM_ID:
|
||||
required: true
|
||||
APPLE_STORE_CONNECT_ISSUER_ID:
|
||||
required: true
|
||||
APPLE_STORE_CONNECT_KEY:
|
||||
required: true
|
||||
APPLE_STORE_CONNECT_KEY_ID:
|
||||
required: true
|
||||
APPLE_TEAM_ID:
|
||||
required: true
|
||||
DISCORD_WEBHOOK_EDGE:
|
||||
required: true
|
||||
DISCORD_WEBHOOK_BETA:
|
||||
required: true
|
||||
DISCORD_WEBHOOK_CANDIDATE:
|
||||
required: true
|
||||
DISCORD_WEBHOOK_STABLE:
|
||||
required: true
|
||||
GOOGLE_PLAY_API:
|
||||
required: true
|
||||
NETLIFY_AUTH_TOKEN:
|
||||
required: true
|
||||
SNAPCRAFT_TOKEN:
|
||||
required: true
|
||||
S3_ACCESS_KEY:
|
||||
required: true
|
||||
S3_BUCKET:
|
||||
required: true
|
||||
S3_ENDPOINT:
|
||||
required: true
|
||||
S3_KEY_ID:
|
||||
required: true
|
||||
S3_REGION:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
android-play-store:
|
||||
name: Play Store
|
||||
if: ${{ inputs.enable-android == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: play-store
|
||||
google-play-key: ${{ secrets.GOOGLE_PLAY_API }}
|
||||
|
||||
- name: Download Play Store Package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: android-playstore-package
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Determine Release Channel
|
||||
id: channel
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
FLAVOR: ${{ inputs.flavor }}
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
const ref = process.env.FLAVOR || 'edge';
|
||||
switch (ref) {
|
||||
case 'beta': return 'alpha';
|
||||
case 'candidate': return 'beta';
|
||||
case 'stable': return 'production';
|
||||
case 'edge':
|
||||
default: return 'internal';
|
||||
}
|
||||
|
||||
- name: Deploy to Google Play Store
|
||||
working-directory: ${{ github.workspace }}/android
|
||||
env:
|
||||
SUPPLY_JSON_KEY: ${{ github.workspace }}/keys/googleplay.json
|
||||
run: bundle exec fastlane deploy_playstore track:${{ steps.channel.outputs.result }} aab:${{ github.workspace }}/output/lunasea-android.aab version_name:${{ inputs.build-title }}
|
||||
|
||||
ios-app-store:
|
||||
name: App Store (iOS)
|
||||
if: ${{ inputs.enable-ios == 'true' }}
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: app-store
|
||||
appstore-connect-key: ${{ secrets.APPLE_STORE_CONNECT_KEY }}
|
||||
|
||||
- name: Download App Store Package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ios-appstore-package
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Deploy to App Store Connect
|
||||
working-directory: ${{ github.workspace }}/ios
|
||||
env:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }}
|
||||
APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
|
||||
APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ github.workspace }}/keys/appstore.p8
|
||||
APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
run: bundle exec fastlane deploy_appstore groups:${{ inputs.flavor }} ipa:${{ github.workspace }}/output/lunasea-ios.ipa
|
||||
|
||||
linux-snapcraft:
|
||||
name: Snapcraft
|
||||
if: ${{ inputs.enable-linux == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: snapcraft
|
||||
snapcraft-token: ${{ secrets.SNAPCRAFT_TOKEN }}
|
||||
|
||||
- name: Download Snap
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: linux-snapcraft
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Deploy to Snapcraft
|
||||
run: snapcraft upload --release=${{ inputs.flavor }} ${{ github.workspace }}/output/lunasea-linux-amd64.snap
|
||||
|
||||
macos-appstore:
|
||||
name: App Store (macOS)
|
||||
if: ${{ inputs.enable-macos == 'true' }}
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: app-store
|
||||
appstore-connect-key: ${{ secrets.APPLE_STORE_CONNECT_KEY }}
|
||||
|
||||
- name: Download App Store Package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macos-appstore-package
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Deploy to App Store Connect
|
||||
working-directory: ${{ github.workspace }}/macos
|
||||
env:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }}
|
||||
APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
|
||||
APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ github.workspace }}/keys/appstore.p8
|
||||
APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
run: bundle exec fastlane deploy_appstore groups:${{ inputs.flavor }} pkg:${{ github.workspace }}/output/lunasea-macos-amd64.pkg
|
||||
|
||||
web-docker:
|
||||
name: Docker
|
||||
if: ${{ inputs.enable-web == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: docker
|
||||
ghcr-actor: ${{ github.actor }}
|
||||
ghcr-token: ${{ github.token }}
|
||||
|
||||
- name: Download Docker Image
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: web-docker
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Load Docker Image
|
||||
run: |
|
||||
docker load --input ${{ github.workspace}}/output/lunasea-web-docker.tar
|
||||
docker image ls -a
|
||||
|
||||
- name: Deploy to GitHub Container Registry
|
||||
run: docker image push --all-tags ghcr.io/jagandeepbrar/lunasea
|
||||
|
||||
web-netlify:
|
||||
name: Netlify
|
||||
if: ${{ inputs.enable-web == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: netlify
|
||||
|
||||
- name: Download Web Package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: web-hosted
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Determine Release Channel
|
||||
id: channel
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
FLAVOR: ${{ inputs.flavor }}
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
const ref = process.env.FLAVOR || 'edge';
|
||||
switch (ref) {
|
||||
case 'beta': return '11ef2676-fc31-41b5-897b-fd21273d87ed';
|
||||
case 'candidate': return '4636e6a1-17ef-45a2-a2b6-3d1c166fd1df';
|
||||
case 'stable': return '6634f0b1-323c-4a2f-bd0b-8f1f388673a9';
|
||||
case 'edge':
|
||||
default: return '325e197e-55f4-449a-b2bb-6831fe47bf2a';
|
||||
}
|
||||
|
||||
- name: Deploy to Netlify
|
||||
uses: nwtgck/actions-netlify@v1.2
|
||||
env:
|
||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
NETLIFY_SITE_ID: ${{ steps.channel.outputs.result }}
|
||||
with:
|
||||
publish-dir: ${{ github.workspace}}/output
|
||||
production-deploy: true
|
||||
deploy-message: ${{ inputs.build-title }}
|
||||
|
||||
s3:
|
||||
name: S3
|
||||
if: ${{ inputs.enable-android == 'true' || inputs.enable-ios == 'true' || inputs.enable-linux == 'true' || inputs.enable-macos == 'true' || inputs.enable-windows == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: s3
|
||||
|
||||
- name: Download Android App Package
|
||||
if: ${{ inputs.enable-android == 'true' }}
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: android-app-package
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Download iOS App Package
|
||||
if: ${{ inputs.enable-ios == 'true' }}
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ios-appstore-package
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Download Linux Snap
|
||||
if: ${{ inputs.enable-linux == 'true' }}
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: linux-snapcraft
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Download macOS App Package
|
||||
if: ${{ inputs.enable-macos == 'true' }}
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macos-app-package
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Download macOS Disk Image
|
||||
if: ${{ inputs.enable-macos == 'true' }}
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macos-disk-image
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Download Windows App Package
|
||||
if: ${{ inputs.enable-windows == 'true' }}
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-app-package
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Download Web Archive
|
||||
if: ${{ inputs.enable-web == 'true' }}
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: web-archive
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Download Windows MSIX Installer
|
||||
if: ${{ inputs.enable-windows == 'true' }}
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-msix-installer
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Upload to S3 Bucket (Build Title)
|
||||
uses: jakejarvis/s3-sync-action@v0.5.1
|
||||
with:
|
||||
args: --acl public-read --follow-symlinks
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
|
||||
AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }}
|
||||
AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
|
||||
AWS_REGION: ${{ secrets.S3_REGION }}
|
||||
SOURCE_DIR: ${{ github.workspace }}/output
|
||||
DEST_DIR: ${{ inputs.build-title }}
|
||||
|
||||
- name: Upload to S3 Bucket (Latest)
|
||||
uses: jakejarvis/s3-sync-action@v0.5.1
|
||||
with:
|
||||
args: --acl public-read --follow-symlinks
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
|
||||
AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }}
|
||||
AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
|
||||
AWS_REGION: ${{ secrets.S3_REGION }}
|
||||
SOURCE_DIR: ${{ github.workspace }}/output
|
||||
DEST_DIR: latest/${{ inputs.flavor }}
|
||||
|
||||
- name: Determine Webhook Channel
|
||||
id: webhook
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
DISCORD_WEBHOOK_EDGE: ${{ secrets.DISCORD_WEBHOOK_EDGE }}
|
||||
DISCORD_WEBHOOK_BETA: ${{ secrets.DISCORD_WEBHOOK_BETA }}
|
||||
DISCORD_WEBHOOK_CANDIDATE: ${{ secrets.DISCORD_WEBHOOK_CANDIDATE }}
|
||||
DISCORD_WEBHOOK_STABLE: ${{ secrets.DISCORD_WEBHOOK_STABLE }}
|
||||
FLAVOR: ${{ inputs.flavor }}
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
const ref = process.env.FLAVOR || 'edge';
|
||||
switch (ref) {
|
||||
case 'beta': return process.env.DISCORD_WEBHOOK_BETA;
|
||||
case 'candidate': return process.env.DISCORD_WEBHOOK_CANDIDATE;
|
||||
case 'stable': return process.env.DISCORD_WEBHOOK_STABLE;
|
||||
case 'edge':
|
||||
default: return process.env.DISCORD_WEBHOOK_EDGE;
|
||||
}
|
||||
|
||||
- name: Send Discord Message
|
||||
uses: sarisia/actions-status-discord@v1
|
||||
with:
|
||||
webhook: ${{ steps.webhook.outputs.result }}
|
||||
username: LunaSea Support
|
||||
avatar_url: https://raw.githubusercontent.com/JagandeepBrar/LunaSea/master/assets/icon/icon.png
|
||||
noprefix: true
|
||||
color: 0x4ECCA3
|
||||
title: ${{ inputs.build-title }}
|
||||
description: '[Download](https://builds.lunasea.app/#${{ inputs.build-title }}/)'
|
||||
55
.github/workflows/publish_android.yml
vendored
Normal file
55
.github/workflows/publish_android.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
name: Publish Android
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
build-title:
|
||||
required: true
|
||||
type: string
|
||||
flavor:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
secrets:
|
||||
GOOGLE_PLAY_API:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
play-store:
|
||||
name: Play Store
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: play-store
|
||||
google-play-key: ${{ secrets.GOOGLE_PLAY_API }}
|
||||
|
||||
- name: Download Play Store Package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: android-playstore-package
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Determine Release Channel
|
||||
id: channel
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
FLAVOR: ${{ inputs.flavor }}
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
const ref = process.env.FLAVOR || 'edge';
|
||||
switch (ref) {
|
||||
case 'beta': return 'alpha';
|
||||
case 'candidate': return 'beta';
|
||||
case 'stable': return 'production';
|
||||
case 'edge':
|
||||
default: return 'internal';
|
||||
}
|
||||
|
||||
- name: Deploy to Google Play Store
|
||||
working-directory: ${{ github.workspace }}/android
|
||||
env:
|
||||
SUPPLY_JSON_KEY: ${{ github.workspace }}/keys/googleplay.json
|
||||
run: bundle exec fastlane deploy_playstore track:${{ steps.channel.outputs.result }} aab:${{ github.workspace }}/output/lunasea-android.aab version_name:${{ inputs.build-title }}
|
||||
53
.github/workflows/publish_ios.yml
vendored
Normal file
53
.github/workflows/publish_ios.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
name: Publish iOS
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
build-title:
|
||||
required: true
|
||||
type: string
|
||||
flavor:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
secrets:
|
||||
APPLE_ID:
|
||||
required: true
|
||||
APPLE_ITC_TEAM_ID:
|
||||
required: true
|
||||
APPLE_STORE_CONNECT_ISSUER_ID:
|
||||
required: true
|
||||
APPLE_STORE_CONNECT_KEY:
|
||||
required: true
|
||||
APPLE_STORE_CONNECT_KEY_ID:
|
||||
required: true
|
||||
APPLE_TEAM_ID:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
app-store:
|
||||
name: App Store (iOS)
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: app-store
|
||||
appstore-connect-key: ${{ secrets.APPLE_STORE_CONNECT_KEY }}
|
||||
|
||||
- name: Download App Store Package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ios-appstore-package
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Deploy to App Store Connect
|
||||
working-directory: ${{ github.workspace }}/ios
|
||||
env:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }}
|
||||
APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
|
||||
APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ github.workspace }}/keys/appstore.p8
|
||||
APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
run: bundle exec fastlane deploy_appstore groups:${{ inputs.flavor }} ipa:${{ github.workspace }}/output/lunasea-ios.ipa
|
||||
35
.github/workflows/publish_linux.yml
vendored
Normal file
35
.github/workflows/publish_linux.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Publish Linux
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
build-title:
|
||||
required: true
|
||||
type: string
|
||||
flavor:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
secrets:
|
||||
SNAPCRAFT_TOKEN:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
snapcraft:
|
||||
name: Snapcraft
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: snapcraft
|
||||
snapcraft-token: ${{ secrets.SNAPCRAFT_TOKEN }}
|
||||
|
||||
- name: Download Snap
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: linux-snapcraft
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Deploy to Snapcraft
|
||||
run: snapcraft upload --release=${{ inputs.flavor }} ${{ github.workspace }}/output/lunasea-linux-amd64.snap
|
||||
53
.github/workflows/publish_macos.yml
vendored
Normal file
53
.github/workflows/publish_macos.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
name: Publish macOS
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
build-title:
|
||||
required: true
|
||||
type: string
|
||||
flavor:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
secrets:
|
||||
APPLE_ID:
|
||||
required: true
|
||||
APPLE_ITC_TEAM_ID:
|
||||
required: true
|
||||
APPLE_STORE_CONNECT_ISSUER_ID:
|
||||
required: true
|
||||
APPLE_STORE_CONNECT_KEY:
|
||||
required: true
|
||||
APPLE_STORE_CONNECT_KEY_ID:
|
||||
required: true
|
||||
APPLE_TEAM_ID:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
app-store:
|
||||
name: App Store (macOS)
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: app-store
|
||||
appstore-connect-key: ${{ secrets.APPLE_STORE_CONNECT_KEY }}
|
||||
|
||||
- name: Download App Store Package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macos-appstore-package
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Deploy to App Store Connect
|
||||
working-directory: ${{ github.workspace }}/macos
|
||||
env:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }}
|
||||
APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
|
||||
APPLE_STORE_CONNECT_KEY_FILEPATH: ${{ github.workspace }}/keys/appstore.p8
|
||||
APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
run: bundle exec fastlane deploy_appstore groups:${{ inputs.flavor }} pkg:${{ github.workspace }}/output/lunasea-macos-amd64.pkg
|
||||
205
.github/workflows/publish_s3.yml
vendored
Normal file
205
.github/workflows/publish_s3.yml
vendored
Normal file
@@ -0,0 +1,205 @@
|
||||
name: Publish S3
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
build-title:
|
||||
required: true
|
||||
type: string
|
||||
flavor:
|
||||
required: true
|
||||
type: string
|
||||
enable-android:
|
||||
required: true
|
||||
type: string
|
||||
enable-ios:
|
||||
required: true
|
||||
type: string
|
||||
enable-linux:
|
||||
required: true
|
||||
type: string
|
||||
enable-macos:
|
||||
required: true
|
||||
type: string
|
||||
enable-web:
|
||||
required: true
|
||||
type: string
|
||||
enable-windows:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
secrets:
|
||||
DISCORD_WEBHOOK_EDGE:
|
||||
required: true
|
||||
DISCORD_WEBHOOK_BETA:
|
||||
required: true
|
||||
DISCORD_WEBHOOK_CANDIDATE:
|
||||
required: true
|
||||
DISCORD_WEBHOOK_STABLE:
|
||||
required: true
|
||||
S3_ACCESS_KEY:
|
||||
required: true
|
||||
S3_BUCKET:
|
||||
required: true
|
||||
S3_ENDPOINT:
|
||||
required: true
|
||||
S3_KEY_ID:
|
||||
required: true
|
||||
S3_REGION:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
s3:
|
||||
name: S3
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: s3
|
||||
|
||||
- name: Download Android App Package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: android-app-package
|
||||
path: ${{ github.workspace }}/output
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Download iOS App Package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ios-appstore-package
|
||||
path: ${{ github.workspace }}/output
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Download Linux Snap
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: linux-snapcraft
|
||||
path: ${{ github.workspace }}/output
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Download macOS App Package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macos-app-package
|
||||
path: ${{ github.workspace }}/output
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Download macOS Disk Image
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macos-disk-image
|
||||
path: ${{ github.workspace }}/output
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Download Windows App Package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-app-package
|
||||
path: ${{ github.workspace }}/output
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Download Web Archive
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: web-archive
|
||||
path: ${{ github.workspace }}/output
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Download Windows MSIX Installer
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-msix-installer
|
||||
path: ${{ github.workspace }}/output
|
||||
if-no-files-found: warn
|
||||
|
||||
- name: Upload to S3 Bucket (Build Title)
|
||||
uses: jakejarvis/s3-sync-action@v0.5.1
|
||||
with:
|
||||
args: --acl public-read --follow-symlinks
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
|
||||
AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }}
|
||||
AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
|
||||
AWS_REGION: ${{ secrets.S3_REGION }}
|
||||
SOURCE_DIR: ${{ github.workspace }}/output
|
||||
DEST_DIR: ${{ inputs.build-title }}
|
||||
|
||||
- name: Upload to S3 Bucket (Latest)
|
||||
uses: jakejarvis/s3-sync-action@v0.5.1
|
||||
with:
|
||||
args: --acl public-read --follow-symlinks
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.S3_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
|
||||
AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }}
|
||||
AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
|
||||
AWS_REGION: ${{ secrets.S3_REGION }}
|
||||
SOURCE_DIR: ${{ github.workspace }}/output
|
||||
DEST_DIR: latest/${{ inputs.flavor }}
|
||||
|
||||
- name: Determine Webhook Channel
|
||||
id: webhook
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
DISCORD_WEBHOOK_EDGE: ${{ secrets.DISCORD_WEBHOOK_EDGE }}
|
||||
DISCORD_WEBHOOK_BETA: ${{ secrets.DISCORD_WEBHOOK_BETA }}
|
||||
DISCORD_WEBHOOK_CANDIDATE: ${{ secrets.DISCORD_WEBHOOK_CANDIDATE }}
|
||||
DISCORD_WEBHOOK_STABLE: ${{ secrets.DISCORD_WEBHOOK_STABLE }}
|
||||
FLAVOR: ${{ inputs.flavor }}
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
const ref = process.env.FLAVOR || 'edge';
|
||||
switch (ref) {
|
||||
case 'beta': return process.env.DISCORD_WEBHOOK_BETA;
|
||||
case 'candidate': return process.env.DISCORD_WEBHOOK_CANDIDATE;
|
||||
case 'stable': return process.env.DISCORD_WEBHOOK_STABLE;
|
||||
case 'edge':
|
||||
default: return process.env.DISCORD_WEBHOOK_EDGE;
|
||||
}
|
||||
|
||||
- name: Create Discord Message
|
||||
id: message
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
BUILD_TITLE: ${{ inputs.build-title }}
|
||||
ANDROID: ${{ inputs.enable-android }}
|
||||
IOS: ${{ inputs.enable-ios }}
|
||||
LINUX: ${{ inputs.enable-linux }}
|
||||
MACOS: ${{ inputs.enable-macos }}
|
||||
WEB: ${{ inputs.enable-web }}
|
||||
WINDOWS: ${{ inputs.enable-windows }}
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
const { ANDROID, IOS, LINUX, MACOS, WEB, WINDOWS } = process.env;
|
||||
const url = `https://builds.lunasea.app/#${ process.env.BUILD_TITLE }`;
|
||||
let _base = `[Download]${url}`;
|
||||
if ( ANDROID || IOS || LINUX || MACOS || WEB || WINDOWS) {
|
||||
_base += '\n\nThis release is only available for the following platforms: ';
|
||||
|
||||
const platforms = [];
|
||||
if (ANDROID) platforms.push('Android');
|
||||
if (IOS) platforms.push('iOS');
|
||||
if (LINUX) platforms.push('Linux');
|
||||
if (MACOS) platforms.push('macOS');
|
||||
if (WEB) platforms.push('Web');
|
||||
if (WINDOWS) platforms.push('Windows');
|
||||
|
||||
_base += platforms.map((p) => `**${p}**`).join(', ');
|
||||
}
|
||||
return _base;
|
||||
|
||||
- name: Send Discord Message
|
||||
uses: sarisia/actions-status-discord@v1
|
||||
with:
|
||||
webhook: ${{ steps.webhook.outputs.result }}
|
||||
username: LunaSea Support
|
||||
avatar_url: https://raw.githubusercontent.com/JagandeepBrar/LunaSea/master/assets/icon/icon.png
|
||||
noprefix: true
|
||||
color: 0x4ECCA3
|
||||
title: ${{ inputs.build-title }}
|
||||
description: ${{ steps.message.outputs.result }}
|
||||
83
.github/workflows/publish_web.yml
vendored
Normal file
83
.github/workflows/publish_web.yml
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
name: Publish Web (Docker)
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
build-title:
|
||||
required: true
|
||||
type: string
|
||||
flavor:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
secrets:
|
||||
NETLIFY_AUTH_TOKEN:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
name: Docker
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: docker
|
||||
ghcr-actor: ${{ github.actor }}
|
||||
ghcr-token: ${{ github.token }}
|
||||
|
||||
- name: Download Docker Image
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: web-docker
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Load Docker Image
|
||||
run: |
|
||||
docker load --input ${{ github.workspace}}/output/lunasea-web-docker.tar
|
||||
docker image ls -a
|
||||
|
||||
- name: Deploy to GitHub Container Registry
|
||||
run: docker image push --all-tags ghcr.io/jagandeepbrar/lunasea
|
||||
|
||||
netlify:
|
||||
name: Netlify
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Environment
|
||||
uses: JagandeepBrar/LunaSea/.github/actions/prepare_for_deployment@master
|
||||
with:
|
||||
channel: netlify
|
||||
|
||||
- name: Download Web Package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: web-hosted
|
||||
path: ${{ github.workspace }}/output
|
||||
|
||||
- name: Determine Release Channel
|
||||
id: channel
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
FLAVOR: ${{ inputs.flavor }}
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
const ref = process.env.FLAVOR || 'edge';
|
||||
switch (ref) {
|
||||
case 'beta': return '11ef2676-fc31-41b5-897b-fd21273d87ed';
|
||||
case 'candidate': return '4636e6a1-17ef-45a2-a2b6-3d1c166fd1df';
|
||||
case 'stable': return '6634f0b1-323c-4a2f-bd0b-8f1f388673a9';
|
||||
case 'edge':
|
||||
default: return '325e197e-55f4-449a-b2bb-6831fe47bf2a';
|
||||
}
|
||||
|
||||
- name: Deploy to Netlify
|
||||
uses: nwtgck/actions-netlify@v1.2
|
||||
env:
|
||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
NETLIFY_SITE_ID: ${{ steps.channel.outputs.result }}
|
||||
with:
|
||||
publish-dir: ${{ github.workspace}}/output
|
||||
production-deploy: true
|
||||
deploy-message: ${{ inputs.build-title }}
|
||||
74
.github/workflows/release.yml
vendored
74
.github/workflows/release.yml
vendored
@@ -114,11 +114,71 @@ jobs:
|
||||
CODE_SIGNING_PUBLISHER: ${{ secrets.CODE_SIGNING_PUBLISHER }}
|
||||
CODE_SIGNING_PUBLISHER_NAME: ${{ secrets.CODE_SIGNING_PUBLISHER_NAME }}
|
||||
|
||||
publish:
|
||||
publish_android:
|
||||
name: Publish Android
|
||||
needs: [ prepare, build-android ]
|
||||
uses: JagandeepBrar/LunaSea/.github/workflows/publish_android.yml@master
|
||||
with:
|
||||
flavor: ${{ github.event.inputs.flavor || 'edge' }}
|
||||
build-title: ${{ needs.prepare.outputs.build-title }}
|
||||
secrets:
|
||||
GOOGLE_PLAY_API: ${{ secrets.GOOGLE_PLAY_API }}
|
||||
|
||||
publish_ios:
|
||||
name: Publish iOS
|
||||
needs: [ prepare, build-ios ]
|
||||
uses: JagandeepBrar/LunaSea/.github/workflows/publish_ios.yml@master
|
||||
with:
|
||||
flavor: ${{ github.event.inputs.flavor || 'edge' }}
|
||||
build-title: ${{ needs.prepare.outputs.build-title }}
|
||||
secrets:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }}
|
||||
APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
|
||||
APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }}
|
||||
APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
|
||||
publish_linux:
|
||||
name: Publish Linux
|
||||
needs: [ prepare, build-linux ]
|
||||
uses: JagandeepBrar/LunaSea/.github/workflows/publish_linux.yml@master
|
||||
with:
|
||||
flavor: ${{ github.event.inputs.flavor || 'edge' }}
|
||||
build-title: ${{ needs.prepare.outputs.build-title }}
|
||||
secrets:
|
||||
SNAPCRAFT_TOKEN: ${{ secrets.SNAPCRAFT_TOKEN }}
|
||||
|
||||
publish_macos:
|
||||
name: Publish macOS
|
||||
needs: [ prepare, build-macos ]
|
||||
uses: JagandeepBrar/LunaSea/.github/workflows/publish_macos.yml@master
|
||||
with:
|
||||
flavor: ${{ github.event.inputs.flavor || 'edge' }}
|
||||
build-title: ${{ needs.prepare.outputs.build-title }}
|
||||
secrets:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }}
|
||||
APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
|
||||
APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }}
|
||||
APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
|
||||
publish_web:
|
||||
name: Publish Web
|
||||
needs: [ prepare, build-web ]
|
||||
uses: JagandeepBrar/LunaSea/.github/workflows/publish_web.yml@master
|
||||
with:
|
||||
flavor: ${{ github.event.inputs.flavor || 'edge' }}
|
||||
build-title: ${{ needs.prepare.outputs.build-title }}
|
||||
secrets:
|
||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
|
||||
publish_s3:
|
||||
name: Publish
|
||||
needs: [ prepare, build-android, build-ios, build-linux, build-macos, build-web, build-windows ]
|
||||
if: ${{ always() }}
|
||||
uses: JagandeepBrar/LunaSea/.github/workflows/publish.yml@master
|
||||
uses: JagandeepBrar/LunaSea/.github/workflows/publish_s3.yml@master
|
||||
with:
|
||||
flavor: ${{ github.event.inputs.flavor || 'edge' }}
|
||||
build-title: ${{ needs.prepare.outputs.build-title }}
|
||||
@@ -128,21 +188,11 @@ jobs:
|
||||
enable-macos: ${{ needs.prepare.outputs.enable-macos }}
|
||||
enable-web: ${{ needs.prepare.outputs.enable-web }}
|
||||
enable-windows: ${{ needs.prepare.outputs.enable-windows }}
|
||||
|
||||
secrets:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_ITC_TEAM_ID: ${{ secrets.APPLE_ITC_TEAM_ID }}
|
||||
APPLE_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
|
||||
APPLE_STORE_CONNECT_KEY: ${{ secrets.APPLE_STORE_CONNECT_KEY }}
|
||||
APPLE_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
DISCORD_WEBHOOK_EDGE: ${{ secrets.DISCORD_WEBHOOK_EDGE }}
|
||||
DISCORD_WEBHOOK_BETA: ${{ secrets.DISCORD_WEBHOOK_BETA }}
|
||||
DISCORD_WEBHOOK_CANDIDATE: ${{ secrets.DISCORD_WEBHOOK_CANDIDATE }}
|
||||
DISCORD_WEBHOOK_STABLE: ${{ secrets.DISCORD_WEBHOOK_STABLE }}
|
||||
GOOGLE_PLAY_API: ${{ secrets.GOOGLE_PLAY_API }}
|
||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
SNAPCRAFT_TOKEN: ${{ secrets.SNAPCRAFT_TOKEN }}
|
||||
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
|
||||
S3_BUCKET: ${{ secrets.S3_BUCKET }}
|
||||
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
|
||||
|
||||
Reference in New Issue
Block a user