chore: remove iOS release and deploy workflows (releasing locally)
Some checks failed
CI / Scraper / Lint (pull_request) Successful in 10s
CI / Scraper / Test (pull_request) Successful in 9s
CI / UI / Build (pull_request) Successful in 15s
CI / Scraper / Docker Push (pull_request) Has been skipped
CI / UI / Docker Push (pull_request) Has been skipped
iOS CI / Build (push) Failing after 1m31s
iOS CI / Test (push) Has been skipped
iOS CI / Build (pull_request) Failing after 1m26s
iOS CI / Test (pull_request) Has been skipped
Some checks failed
CI / Scraper / Lint (pull_request) Successful in 10s
CI / Scraper / Test (pull_request) Successful in 9s
CI / UI / Build (pull_request) Successful in 15s
CI / Scraper / Docker Push (pull_request) Has been skipped
CI / UI / Docker Push (pull_request) Has been skipped
iOS CI / Build (push) Failing after 1m31s
iOS CI / Test (push) Has been skipped
iOS CI / Build (pull_request) Failing after 1m26s
iOS CI / Test (pull_request) Has been skipped
This commit is contained in:
@@ -1,138 +0,0 @@
|
|||||||
name: Deploy
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "**"
|
|
||||||
paths:
|
|
||||||
- "scraper/**"
|
|
||||||
- "ui/**"
|
|
||||||
- "docker-compose.yml"
|
|
||||||
pull_request:
|
|
||||||
types: [closed]
|
|
||||||
|
|
||||||
# tRPC API helper notes:
|
|
||||||
# Mutations: POST /api/trpc/<router>.<procedure>
|
|
||||||
# Body: {"0":{"json":{...input...}}}
|
|
||||||
# Header: x-api-key: <token>
|
|
||||||
# Queries: GET /api/trpc/<router>.<procedure>?batch=1&input={"0":{"json":{...input...}}}
|
|
||||||
# Header: x-api-key: <token>
|
|
||||||
# Response on success: HTTP 200, body: [{"result":{"data":{"json":{...}}}}]
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# ── production deploy (main/master only) ─────────────────────────────────────
|
|
||||||
deploy-production:
|
|
||||||
name: Deploy Production
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: >
|
|
||||||
gitea.event_name == 'push' &&
|
|
||||||
(gitea.ref == 'refs/heads/main' || gitea.ref == 'refs/heads/master')
|
|
||||||
steps:
|
|
||||||
- name: Redeploy production stack
|
|
||||||
run: |
|
|
||||||
RESPONSE=$(curl -s -w "\n%{http_code}" \
|
|
||||||
-X POST "${{ secrets.DOKPLOY_URL }}/api/trpc/compose.redeploy" \
|
|
||||||
-H "x-api-key: ${{ secrets.DOKPLOY_TOKEN }}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d '{"0":{"json":{"composeId":"${{ secrets.DOKPLOY_COMPOSE_ID }}"}}}')
|
|
||||||
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
|
|
||||||
BODY=$(echo "$RESPONSE" | head -1)
|
|
||||||
echo "Status: $HTTP_CODE"
|
|
||||||
echo "Body: $BODY"
|
|
||||||
[ "$HTTP_CODE" = "200" ] || { echo "Redeploy failed"; exit 1; }
|
|
||||||
|
|
||||||
# ── preview deploy (feature branches) ────────────────────────────────────────
|
|
||||||
deploy-preview:
|
|
||||||
name: Deploy Preview
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: >
|
|
||||||
gitea.event_name == 'push' &&
|
|
||||||
gitea.ref != 'refs/heads/main' &&
|
|
||||||
gitea.ref != 'refs/heads/master'
|
|
||||||
steps:
|
|
||||||
- name: Sanitize branch name
|
|
||||||
id: branch
|
|
||||||
run: |
|
|
||||||
# Lowercase, replace non-alphanumeric with dashes, strip trailing dashes, max 20 chars
|
|
||||||
SUFFIX=$(echo "${{ gitea.ref_name }}" \
|
|
||||||
| tr '[:upper:]' '[:lower:]' \
|
|
||||||
| sed 's/[^a-z0-9]/-/g' \
|
|
||||||
| cut -c1-20 \
|
|
||||||
| sed 's/-*$//')
|
|
||||||
echo "suffix=$SUFFIX" >> $GITHUB_OUTPUT
|
|
||||||
echo "Preview suffix: $SUFFIX"
|
|
||||||
|
|
||||||
- name: Create or redeploy isolated preview stack
|
|
||||||
run: |
|
|
||||||
# compose.isolatedDeployment creates a new isolated copy of the compose stack
|
|
||||||
# suffixed with the branch name. If the stack already exists it redeploys it.
|
|
||||||
RESPONSE=$(curl -s -w "\n%{http_code}" \
|
|
||||||
-X POST "${{ secrets.DOKPLOY_URL }}/api/trpc/compose.isolatedDeployment" \
|
|
||||||
-H "x-api-key: ${{ secrets.DOKPLOY_TOKEN }}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "{\"0\":{\"json\":{\"composeId\":\"${{ secrets.DOKPLOY_COMPOSE_ID }}\",\"suffix\":\"${{ steps.branch.outputs.suffix }}\"}}}")
|
|
||||||
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
|
|
||||||
BODY=$(echo "$RESPONSE" | head -1)
|
|
||||||
echo "Status: $HTTP_CODE"
|
|
||||||
echo "Body: $BODY"
|
|
||||||
[ "$HTTP_CODE" = "200" ] || { echo "Preview deploy failed"; exit 1; }
|
|
||||||
|
|
||||||
# ── cleanup preview on PR close ───────────────────────────────────────────────
|
|
||||||
cleanup-preview:
|
|
||||||
name: Cleanup Preview
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: gitea.event_name == 'pull_request' && gitea.event.action == 'closed'
|
|
||||||
steps:
|
|
||||||
- name: Sanitize branch name
|
|
||||||
id: branch
|
|
||||||
run: |
|
|
||||||
SUFFIX=$(echo "${{ gitea.head_ref }}" \
|
|
||||||
| tr '[:upper:]' '[:lower:]' \
|
|
||||||
| sed 's/[^a-z0-9]/-/g' \
|
|
||||||
| cut -c1-20 \
|
|
||||||
| sed 's/-*$//')
|
|
||||||
echo "suffix=$SUFFIX" >> $GITHUB_OUTPUT
|
|
||||||
echo "Cleaning up preview suffix: $SUFFIX"
|
|
||||||
|
|
||||||
- name: Search for preview compose stack by appName
|
|
||||||
id: find
|
|
||||||
run: |
|
|
||||||
# compose.search is a tRPC query (GET). We search by appName pattern.
|
|
||||||
# appName is set by Dokploy as "<base-appName>-<suffix>" for isolated deployments.
|
|
||||||
INPUT=$(python3 -c "import json,sys; print(json.dumps({'0':{'json':{'appName':'libnovel-${{ steps.branch.outputs.suffix }}','limit':5,'offset':0}}}))")
|
|
||||||
RESPONSE=$(curl -s -w "\n%{http_code}" -G \
|
|
||||||
"${{ secrets.DOKPLOY_URL }}/api/trpc/compose.search" \
|
|
||||||
-H "x-api-key: ${{ secrets.DOKPLOY_TOKEN }}" \
|
|
||||||
--data-urlencode "batch=1" \
|
|
||||||
--data-urlencode "input=$INPUT")
|
|
||||||
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
|
|
||||||
BODY=$(echo "$RESPONSE" | head -1)
|
|
||||||
echo "Status: $HTTP_CODE"
|
|
||||||
echo "Body: $BODY"
|
|
||||||
# Extract the first composeId from the JSON response array
|
|
||||||
COMPOSE_ID=$(echo "$BODY" | python3 -c "
|
|
||||||
import json,sys
|
|
||||||
data = json.load(sys.stdin)
|
|
||||||
items = data[0]['result']['data']['json']['items']
|
|
||||||
print(items[0]['composeId'] if items else '')
|
|
||||||
" 2>/dev/null || echo "")
|
|
||||||
echo "composeId=$COMPOSE_ID" >> $GITHUB_OUTPUT
|
|
||||||
echo "Found composeId: $COMPOSE_ID"
|
|
||||||
|
|
||||||
- name: Delete preview stack
|
|
||||||
if: steps.find.outputs.composeId != ''
|
|
||||||
run: |
|
|
||||||
RESPONSE=$(curl -s -w "\n%{http_code}" \
|
|
||||||
-X POST "${{ secrets.DOKPLOY_URL }}/api/trpc/compose.delete" \
|
|
||||||
-H "x-api-key: ${{ secrets.DOKPLOY_TOKEN }}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "{\"0\":{\"json\":{\"composeId\":\"${{ steps.find.outputs.composeId }}\",\"deleteVolumes\":true}}}")
|
|
||||||
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
|
|
||||||
BODY=$(echo "$RESPONSE" | head -1)
|
|
||||||
echo "Status: $HTTP_CODE"
|
|
||||||
echo "Body: $BODY"
|
|
||||||
[ "$HTTP_CODE" = "200" ] || { echo "Delete failed"; exit 1; }
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
name: iOS Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "ios-v*"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ios-macos-runner
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# ── archive & release to TestFlight ──────────────────────────────────────
|
|
||||||
# Triggered only on ios-v* tags (e.g. ios-v1.0.0).
|
|
||||||
# Required secrets:
|
|
||||||
# APPLE_CERTIFICATE_BASE64 - Distribution certificate (.p12) base64-encoded
|
|
||||||
# APPLE_CERTIFICATE_PASSWORD - Password for the .p12 file
|
|
||||||
# APPLE_PROVISIONING_PROFILE_BASE64 - App Store distribution profile base64-encoded
|
|
||||||
# KEYCHAIN_PASSWORD - Temporary keychain password (any random string)
|
|
||||||
# ASC_KEY_ID - App Store Connect API key ID
|
|
||||||
# ASC_ISSUER_ID - App Store Connect issuer ID
|
|
||||||
# ASC_PRIVATE_KEY - Contents of the .p8 private key file
|
|
||||||
# APPLE_TEAM_ID - 10-character Apple Developer team ID (GHZXC6FVMU)
|
|
||||||
release:
|
|
||||||
name: Release to TestFlight
|
|
||||||
runs-on: macos-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Ruby with rbenv
|
|
||||||
run: |
|
|
||||||
# Install rbenv and ruby-build if not already installed
|
|
||||||
brew install rbenv ruby-build || true
|
|
||||||
|
|
||||||
# Install Ruby 3.2.2
|
|
||||||
rbenv install 3.2.2 --skip-existing
|
|
||||||
rbenv global 3.2.2
|
|
||||||
|
|
||||||
# Add rbenv to PATH for subsequent steps
|
|
||||||
echo "$(rbenv root)/shims" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
# Verify Ruby version
|
|
||||||
eval "$(rbenv init -)"
|
|
||||||
ruby --version
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
working-directory: ios/LibNovel
|
|
||||||
run: |
|
|
||||||
eval "$(rbenv init -)"
|
|
||||||
gem install bundler
|
|
||||||
bundle install
|
|
||||||
|
|
||||||
- name: Import signing certificate
|
|
||||||
env:
|
|
||||||
CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
|
|
||||||
CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
|
||||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
|
||||||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
|
||||||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
|
||||||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
|
||||||
echo "$CERTIFICATE_BASE64" | base64 --decode > $RUNNER_TEMP/cert.p12
|
|
||||||
security import $RUNNER_TEMP/cert.p12 \
|
|
||||||
-P "$CERTIFICATE_PASSWORD" \
|
|
||||||
-A -t cert -f pkcs12 \
|
|
||||||
-k $KEYCHAIN_PATH
|
|
||||||
security list-keychain -d user -s $KEYCHAIN_PATH $(security list-keychains -d user | tr -d '"' | xargs)
|
|
||||||
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
|
||||||
|
|
||||||
- name: Import provisioning profile
|
|
||||||
env:
|
|
||||||
PROFILE_BASE64: ${{ secrets.APPLE_PROVISIONING_PROFILE_BASE64 }}
|
|
||||||
run: |
|
|
||||||
PP_PATH=$RUNNER_TEMP/profile.mobileprovision
|
|
||||||
echo "$PROFILE_BASE64" | base64 --decode > $PP_PATH
|
|
||||||
UUID=$(security cms -D -i "$PP_PATH" | plutil -extract UUID raw -)
|
|
||||||
PROFILE_NAME=$(security cms -D -i "$PP_PATH" | plutil -extract Name raw -)
|
|
||||||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
|
||||||
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/$UUID.mobileprovision
|
|
||||||
echo "Installed profile: $PROFILE_NAME (UUID: $UUID)"
|
|
||||||
echo "PROFILE_NAME=$PROFILE_NAME" >> $GITHUB_ENV
|
|
||||||
echo "PROFILE_UUID=$UUID" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build and upload to TestFlight
|
|
||||||
env:
|
|
||||||
USER: runner
|
|
||||||
LC_ALL: en_US.UTF-8
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
APPLE_KEY_ID: ${{ secrets.ASC_KEY_ID }}
|
|
||||||
APPLE_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
|
|
||||||
APPLE_KEY_CONTENT: ${{ secrets.ASC_PRIVATE_KEY }}
|
|
||||||
BUILD_NUMBER: ${{ gitea.run_number }}
|
|
||||||
working-directory: ios/LibNovel
|
|
||||||
run: |
|
|
||||||
eval "$(rbenv init -)"
|
|
||||||
echo "Using provisioning profile: $PROFILE_NAME (UUID: $PROFILE_UUID)"
|
|
||||||
export PROVISIONING_PROFILE_NAME="$PROFILE_NAME"
|
|
||||||
export PROVISIONING_PROFILE_UUID="$PROFILE_UUID"
|
|
||||||
bundle exec fastlane beta
|
|
||||||
|
|
||||||
- name: Cleanup keychain
|
|
||||||
if: always()
|
|
||||||
run: security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
|
|
||||||
Reference in New Issue
Block a user