mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-08 16:27:31 +00:00
cd: add github action to trigger Circle CI pipeline
This commit is contained in:
parent
5dd958076b
commit
95b197a304
@ -8,9 +8,31 @@ jobs:
|
|||||||
machine:
|
machine:
|
||||||
image: ubuntu-2204:current
|
image: ubuntu-2204:current
|
||||||
resource_class: arm.medium
|
resource_class: arm.medium
|
||||||
|
parameters:
|
||||||
|
version:
|
||||||
|
type: string
|
||||||
|
default: 3.1.1
|
||||||
|
channel:
|
||||||
|
type: enum
|
||||||
|
enum:
|
||||||
|
- release
|
||||||
|
- nightly
|
||||||
|
default: release
|
||||||
|
github_run_number:
|
||||||
|
type: string
|
||||||
|
default: "0"
|
||||||
|
dry_run:
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- gh/setup
|
- gh/setup
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Get current date
|
||||||
|
command: |
|
||||||
|
echo "export CURRENT_DATE=$(date +%Y-%m-%d)" >> $BASH_ENV
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Install dependencies
|
name: Install dependencies
|
||||||
command: |
|
command: |
|
||||||
@ -38,10 +60,23 @@ jobs:
|
|||||||
paths:
|
paths:
|
||||||
- .
|
- .
|
||||||
|
|
||||||
- run:
|
- when:
|
||||||
name: Replace texts in files
|
condition:
|
||||||
command: |
|
equal: [<< parameters.channel >>, nightly]
|
||||||
echo "build_arch: aarch64" >> linux/packaging/rpm/make_config.yaml
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Replace pubspec version and BUILD_VERSION Env (nightly)
|
||||||
|
command: |
|
||||||
|
curl -sS https://webi.sh/yq | sh
|
||||||
|
yq -i '.version |= sub("\+\d+", "+<< parameters.channel >>.")' pubspec.yaml
|
||||||
|
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
|
||||||
|
echo 'export BUILD_VERSION="<< parameters.version >>+<< parameters.channel >>.<< parameters.github_run_number >>"' >> $BASH_ENV
|
||||||
|
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [<< parameters.channel >>, release]
|
||||||
|
steps:
|
||||||
|
- run: echo 'export BUILD_VERSION="<< parameters.version >>"' >> $BASH_ENV
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Generate .env file
|
name: Generate .env file
|
||||||
@ -50,6 +85,12 @@ jobs:
|
|||||||
echo "SUPABASE_URL=${SUPABASE_URL}" >> .env
|
echo "SUPABASE_URL=${SUPABASE_URL}" >> .env
|
||||||
echo "SUPABASE_API_KEY=${SUPABASE_API_KEY}" >> .env
|
echo "SUPABASE_API_KEY=${SUPABASE_API_KEY}" >> .env
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Replace Version in files
|
||||||
|
command: |
|
||||||
|
sed -i 's|%{{APPDATA_RELEASE}}%|<release version="${BUILD_VERSION}" date="${CURRENT_DATE}" />|' linux/com.github.KRTirtho.Spotube.appdata.xml
|
||||||
|
echo "build_arch: aarch64" >> linux/packaging/rpm/make_config.yaml
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Build secrets
|
name: Build secrets
|
||||||
command: |
|
command: |
|
||||||
@ -68,7 +109,18 @@ jobs:
|
|||||||
flutter_distributor package --platform=linux --targets=deb
|
flutter_distributor package --platform=linux --targets=deb
|
||||||
flutter_distributor package --platform=linux --targets=appimage
|
flutter_distributor package --platform=linux --targets=appimage
|
||||||
flutter_distributor package --platform=linux --targets=rpm
|
flutter_distributor package --platform=linux --targets=rpm
|
||||||
make tar VERSION=nightly ARCH=arm64 PKG_ARCH=aarch64
|
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [<< parameters.channel >>, nightly]
|
||||||
|
steps:
|
||||||
|
- run: make tar VERSION=nightly ARCH=arm64 PKG_ARCH=aarch64
|
||||||
|
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [<< parameters.channel >>, release]
|
||||||
|
steps:
|
||||||
|
- run: make tar VERSION=${BUILD_VERSION} ARCH=arm64 PKG_ARCH=aarch64
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Move artifacts
|
name: Move artifacts
|
||||||
@ -83,12 +135,43 @@ jobs:
|
|||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: Spotube-linux-aarch64.zip
|
path: Spotube-linux-aarch64.zip
|
||||||
|
|
||||||
- run:
|
- when:
|
||||||
name: Upload to release
|
condition:
|
||||||
command: gh release upload nightly bundle/* --clobber
|
and:
|
||||||
|
- equal: [<< parameters.dry_run >>, false]
|
||||||
|
- equal: [<< parameters.channel >>, release]
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Upload to release (release)
|
||||||
|
command: gh release upload v<< parameters.version >> bundle/* --clobber
|
||||||
|
|
||||||
|
- when:
|
||||||
|
condition:
|
||||||
|
and:
|
||||||
|
- equal: [<< parameters.dry_run >>, false]
|
||||||
|
- equal: [<< parameters.channel >>, nightly]
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Upload to release (nightly)
|
||||||
|
command: gh release upload nightly bundle/* --clobber
|
||||||
|
|
||||||
|
parameters:
|
||||||
|
GHA_Actor:
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
GHA_Action:
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
GHA_Event:
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
GHA_Meta:
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
build_flutter_for_arm_workflow:
|
build_flutter_for_arm_workflow:
|
||||||
|
when: << pipeline.parameters.GHA_Action >>
|
||||||
jobs:
|
jobs:
|
||||||
- flutter_linux_arm:
|
- flutter_linux_arm:
|
||||||
context:
|
context:
|
||||||
|
|||||||
15
.github/workflows/spotube-release-binary.yml
vendored
15
.github/workflows/spotube-release-binary.yml
vendored
@ -26,7 +26,7 @@ on:
|
|||||||
default: true
|
default: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FLUTTER_VERSION: '3.10.0'
|
FLUTTER_VERSION: '3.13.2'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
windows:
|
windows:
|
||||||
@ -322,6 +322,19 @@ jobs:
|
|||||||
name: Spotube-Release-Binaries
|
name: Spotube-Release-Binaries
|
||||||
path: |
|
path: |
|
||||||
build/Spotube-macos-universal.dmg
|
build/Spotube-macos-universal.dmg
|
||||||
|
|
||||||
|
linux_arm:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.1.0
|
||||||
|
env:
|
||||||
|
CCI_TOKEN: ${{ secrets.CCI_TOKEN }}
|
||||||
|
with:
|
||||||
|
GHA_Action: true
|
||||||
|
version: ${{ inputs.version }}
|
||||||
|
channel: ${{ inputs.channel }}
|
||||||
|
github_run_number: ${{ github.run_number }}
|
||||||
|
dry_run: ${{ inputs.dry_run }}
|
||||||
|
|
||||||
upload:
|
upload:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user