Skip to content

Commit

Permalink
Sync with fedibtc/fedi 69e3d0d9d46ecde69e44b92bd62a700bd3c0685b (#9)
Browse files Browse the repository at this point in the history
Co-authored-by: Fedi CI <[email protected]>
  • Loading branch information
fedigord and Fedi CI authored Nov 24, 2024
1 parent 6cda123 commit 3124946
Show file tree
Hide file tree
Showing 184 changed files with 9,707 additions and 4,409 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ _Please fill in as many fields as you can so we can swiftly investigate_

#### Context
_Federation_:
_Fedi app version_:
_Phone OS_:
_User Name_"

Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/bump-version-native-ui.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
name: Bump version - Native UI
on:
workflow_dispatch:
push:
branches:
- 'release/**.**'
- '!release/**.**.**'
paths:
- 'bridge/**'
- 'ui/native/**'
- 'ui/common/**'
- '!ui/native/ios/**' # Don't run for changes in /ios folder
jobs:
bump-version:
permissions:
Expand All @@ -23,7 +14,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v26
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-22.05

Expand Down
45 changes: 38 additions & 7 deletions .github/workflows/deploy-public-apk-to-github.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy Public APK to Github
name: Deploy Public APK
on:
release:
# these events will not fire for draft releases
# will not fire for draft releases
types: [published, edited]

jobs:
Expand All @@ -11,14 +11,45 @@ jobs:
- name: Checkout script in repo
uses: actions/checkout@v4

- name: Run publish-release
- name: Prepare APK for Vercel deployment
uses: actions/github-script@v7
id: publish-release
id: prepare-apk
env:
RELEASE_ID: ${{ github.event.release.id }}
RELEASE_ID: ${{ github.event.release.id || vars.TEST_RELEASE_ID }}
SOURCE_FEDI_ORG: ${{ vars.SOURCE_FEDI_ORG }}
SOURCE_FEDI_REPO: ${{ vars.SOURCE_FEDI_REPO }}
with:
github-token: ${{ secrets.DEPLOY_APK_ACCESS_TOKEN }}
github-token: ${{ secrets.DOWNLOAD_APK_ACCESS_TOKEN }}
result-encoding: string
script: |
const script = require('./scripts/ci/deploy-public-apk.js')
const script = require('./scripts/ci/prepare-apk.js')
await script({github, context, core})
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-23.05

- uses: cachix/cachix-action@v15
with:
name: fedibtc
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Deploy APK to Vercel
id: deploy
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_APK_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
run: nix develop .#vercel -c ./scripts/ci/vercel-apk.sh

- name: Update public repo
uses: actions/github-script@v7
env:
PUBLIC_APK_URL: ${{ vars.PUBLIC_APK_URL }}
PUBLIC_FEDI_ORG: ${{ vars.PUBLIC_FEDI_ORG }}
PUBLIC_FEDI_REPO: ${{ vars.PUBLIC_FEDI_REPO }}
with:
github-token: ${{ secrets.PUBLISH_APK_ACCESS_TOKEN }}
script: |
const script = require('./scripts/ci/publish-release.js')
await script({github, context, core})
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-22.05

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-gp-internal-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-22.05

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-to-testflight-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-22.05

Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/deploy-to-testflight.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
name: Deploy to TestFlight
on:
workflow_dispatch:
pull_request:
types:
- closed
branches:
- 'master'
workflow_call:

jobs:
release-ios:
if: >
(github.event_name == 'workflow_dispatch') ||
(
github.event.pull_request.merged == true &&
startsWith(github.head_ref, 'release/')
)
name: Build iOS app and upload to TestFlight
timeout-minutes: 60
runs-on: [self-hosted, macos, arm64]
steps:
- name: Checkout repo
uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-22.05

Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-22.05
- uses: cachix/cachix-action@v15
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
needs.precheck.outputs.IS_PUSH_TO_TAG == '1'
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-22.05
- uses: cachix/cachix-action@v15
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-22.05
- uses: cachix/cachix-action@v15
Expand All @@ -174,6 +174,9 @@ jobs:
- name: Build fedi-api-types
run: nix build -L .#ci.fedi-api-types

- name: Build fedi-ffi
run: nix build -L .#ci.fedi-ffi

- name: Build fedi-wasm
run: nix build -L .#wasm32-unknown.ci.fedi-wasm

Expand All @@ -189,6 +192,7 @@ jobs:
- name: Build fedimint-dbtool
run: nix build -L .#fedimint-dbtool


# Since cargo-udeps supports only `test` profile and thus can't re-use any
# other derivations, we can start it in separate workflow
udeps:
Expand All @@ -202,7 +206,7 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-22.05
- uses: cachix/cachix-action@v15
Expand All @@ -223,7 +227,7 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-22.05
- uses: cachix/cachix-action@v15
Expand All @@ -234,6 +238,9 @@ jobs:
- name: Build Android bridge artifacts
run: nix develop --ignore-environment --command env HOME="$HOME" BUILD_ALL_BRIDGE_TARGETS=1 CARGO_PROFILE=ci scripts/ci/run-in-fs-dir-cache.sh build-bridge-android ./scripts/bridge/build-bridge-android.sh

- name: Build fedi-ffi
run: nix build -L .#aarch64-android.ci.fedi-ffi

build-ios:
name: 'Build - macos'
needs: precheck
Expand All @@ -244,7 +251,7 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-22.05
- uses: cachix/cachix-action@v15
Expand Down Expand Up @@ -284,7 +291,7 @@ jobs:
- uses: actions/checkout@v4
if: github.ref == 'refs/heads/master' || matrix.build-in-pr

- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
if: github.ref == 'refs/heads/master' || matrix.build-in-pr
with:
nix_path: nixpkgs=channel:nixos-22.05
Expand Down Expand Up @@ -316,7 +323,7 @@ jobs:
- name: Prepare
uses: ./.github/actions/prepare
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-23.11
extra_nix_config: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Release Fedi Nightly
on:
workflow_dispatch:
schedule:
schedule: # runs every day at 5am UTC
- cron: '0 5 * * *'

jobs:
Expand All @@ -14,7 +14,7 @@ jobs:
with:
submodules: true

- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-22.05

Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/release-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release Fedi (Production)
on:
workflow_dispatch:

jobs:
release-production-apk:
name: Build Android APK and upload to GitHub draft release
runs-on: [self-hosted, linux]
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: true

- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-22.05

- uses: cachix/cachix-action@v15
with:
name: fedibtc
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Build bridge
run: nix develop -c env BUILD_ALL_BRIDGE_TARGETS=1 CARGO_PROFILE=release scripts/ci/run-in-fs-dir-cache.sh build-bridge-android ./scripts/bridge/build-bridge-android.sh

- name: Build UI dependencies
run: nix develop -c ./scripts/ui/build-deps.sh

- name: Prep for APK build
id: prep-apk
run: nix develop -c ./scripts/ci/prep-apk.sh

- name: Build APK
env:
APK_PATH: ${{ steps.prep-apk.outputs.APK_PATH }}
# Consider: should we even have separate steps above for this?
BUILD_BRIDGE: 0
BUILD_UI_DEPS: 0
run: nix develop -c ./scripts/ui/build-production-apk.sh

- name: Verify bridge hash
env:
APK_PATH: ${{ steps.prep-apk.outputs.APK_PATH }}
run: |
set -euo pipefail
bash ./scripts/ci/verify-bridge-hash.sh "$APK_PATH" "${{ github.sha }}"
- name: Create draft GitHub release with APK
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.prep-apk.outputs.APK_VERSION }}
name: 'Fedi v${{ steps.prep-apk.outputs.APK_VERSION }}'
body: 'Built from commit: ${{ github.sha }}'
draft: true
append_body: true
files: ${{ steps.prep-apk.outputs.APK_PATH }}

call-deployment-workflow:
name: Trigger deployment to Google Play for Internal Testing
needs: release-production-apk # wait for APK build so we can reuse cached bridge artifacts
uses: ./.github/workflows/deploy-to-gp-internal-testing.yml
secrets: inherit
if: >-
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.ref, 'refs/heads/master')
call-deployment-workflow-testflight:
name: Trigger deployment to TestFlight
uses: ./.github/workflows/deploy-to-testflight.yml
secrets: inherit
if: >-
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.ref, 'refs/heads/master')
2 changes: 1 addition & 1 deletion .github/workflows/test-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-23.05

Expand Down
Loading

0 comments on commit 3124946

Please sign in to comment.