Database Universe release #78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Database Universe release | |
on: | |
workflow_dispatch: | |
inputs: | |
database_universe_version: | |
description: "Database Universe Example: 0.0.1" | |
required: false | |
default: "" | |
is_publish_to_pub_dev: | |
description: "yes or no" | |
required: false | |
default: "yes" | |
env: # Global variables | |
VERSION: "0.0.0-placeholder" | |
jobs: | |
build_binaries: | |
name: Build Binaries | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: macos-latest | |
artifact_name: libdatabase_universe_android_arm64.so | |
script: build_android.sh | |
- os: macos-latest | |
artifact_name: libdatabase_universe_android_armv7.so | |
script: build_android.sh armv7 | |
- os: macos-latest | |
artifact_name: libdatabase_universe_android_x64.so | |
script: build_android.sh x64 | |
- os: macos-latest | |
artifact_name: database_universe_ios.xcframework.zip | |
script: build_ios.sh | |
- os: ubuntu-24.04 | |
artifact_name: libdatabase_universe_linux_x64.so | |
script: build_linux.sh x64 | |
- os: macos-latest | |
artifact_name: libdatabase_universe_macos.dylib | |
script: build_macos.sh | |
- os: windows-latest | |
artifact_name: database_universe_windows_x64.dll | |
script: build_windows.sh x64 | |
- os: ubuntu-latest | |
artifact_name: database_universe.wasm | |
script: build_wasm.sh | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare Build | |
uses: ./.github/actions/prepare-build | |
- name: Check and Set Global Env | |
if: ${{ github.event.inputs.database_universe_version != '' }} | |
run: echo "VERSION=${{ github.event.inputs.database_universe_version }}" >> $GITHUB_ENV | |
- name: Set Isar Version | |
run: | | |
echo "DATABASE_UNIVERSE_VERSION=$VERSION" >> $GITHUB_ENV | |
echo "DATABASE_UNIVERSE_VERSION=$VERSION" | |
- name: Build binary | |
run: bash tool/${{ matrix.script }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.artifact_name }} | |
path: | | |
${{ matrix.artifact_name }} | |
- name: Upload Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.TOKEN_GITHUB }} | |
file: ${{ matrix.artifact_name }} | |
asset_name: ${{ matrix.artifact_name }} | |
tag: "${{ github.ref }}-${{env.VERSION}}" | |
overwrite: true | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: Wait for tests to succeed | |
uses: lewagon/[email protected] | |
with: | |
ref: ${{ github.ref }} | |
running-workflow-name: "Publish" | |
repo-token: ${{ secrets.TOKEN_GITHUB }} | |
wait-interval: 10 | |
- name: Check and Set Global Env | |
if: ${{ github.event.inputs.database_universe_version != '' }} | |
run: echo "VERSION=${{ github.event.inputs.database_universe_version }}" >> $GITHUB_ENV | |
- name: Set Isar Version | |
run: | | |
echo "DATABASE_UNIVERSE_VERSION=$VERSION" >> $GITHUB_ENV | |
echo "DATABASE_UNIVERSE_VERSION=$VERSION" | |
- name: Download Binaries | |
run: sh tool/download_binaries.sh | |
- name: Adjust Version | |
run: find . -type f -exec sed -i "s/0.0.0-placeholder/$VERSION/g" {} + | |
- name: pub.dev credentials | |
run: | | |
mkdir -p $HOME/.config/dart | |
echo '${{ secrets.PUBDEV_CREDENTIALS }}' >> $HOME/.config/dart/pub-credentials.json | |
- name: Pub Get database_universe | |
working-directory: library/database_universe | |
run: | | |
dart pub get | |
dart format . | |
- name: Pub Get database_universe_flutter_libs | |
working-directory: library/database_universe_flutter_libs | |
run: | | |
flutter pub get | |
dart format . | |
- name: Archived | |
run: | | |
tar -czvf database_universe.tar.gz library/database_universe/ | |
tar -czvf database_universe_flutter_libs.tar.gz library/database_universe_flutter_libs/ | |
- name: Upload Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.TOKEN_GITHUB }} | |
file: database_universe.tar.gz | |
asset_name: database_universe.tar.gz | |
tag: "${{ github.ref }}-${{env.VERSION}}" | |
overwrite: true | |
- name: Upload Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.TOKEN_GITHUB }} | |
file: database_universe_flutter_libs.tar.gz | |
asset_name: database_universe_flutter_libs.tar.gz | |
tag: "${{ github.ref }}-${{env.VERSION}}" | |
overwrite: true | |
- name: Publish database_universe | |
if: ${{ github.event.inputs.is_publish_to_pub_dev == 'yes' }} | |
working-directory: library/database_universe | |
run: | | |
dart pub publish --force | |
- name: Publish database_universe_flutter_libs | |
if: ${{ github.event.inputs.is_publish_to_pub_dev == 'yes' }} | |
working-directory: library/database_universe_flutter_libs | |
run: | | |
flutter pub publish --force |