Skip to content

fix: revert checkout to original hash #124

fix: revert checkout to original hash

fix: revert checkout to original hash #124

Workflow file for this run

name: CI
on:
push:
branches:
- ori
paths:
- '**'
- '!**.md'
- '!.github/**'
- '.github/scripts/**'
- '.github/workflows/build_push.yml'
workflow_dispatch:
permissions: {}
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
env:
CI_CHUNK_SIZE: 65
IS_PR_CHECK: false
jobs:
prepare:
name: Prepare job
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
matrix: ${{ steps.generate-matrices.outputs.matrix }}
delete: ${{ steps.generate-matrices.outputs.delete }}
steps:
- name: Checkout ori branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
persist-credentials: false
- name: Get last successful CI commit
uses: nrwl/nx-set-shas@afb73a62d26e41464e9254689e1fd6122ee683c1
with:
fallback-sha: 4b825dc642cb6eb9a060e54bf8d69288fbee4904
- id: generate-matrices
name: Create output matrices
run: |
python ./.github/scripts/generate-build-matrices.py "$NX_BASE" Release
build:
name: Build extensions (${{ matrix.chunk.number }})
needs: prepare
runs-on: ubuntu-latest
timeout-minutes: 30
if: ${{ toJson(fromJson(needs.prepare.outputs.matrix).chunk) != '[]' }}
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
steps:
- name: Checkout ori branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
with:
java-version: 17
distribution: temurin
- name: Set up Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c
with:
cache-read-only: ${{ matrix.chunk.number > 1 }}
- name: Auto format
run: ./gradlew spotlessApply
- name: Prepare signing key
run: |
echo ${{ secrets.SIGNING_KEY }} | base64 -d > signingkey.jks
- name: Build extensions (${{ matrix.chunk.number }})
env:
MODULES: ${{ join(matrix.chunk.modules, ' ') }}
ALIAS: ${{ secrets.ALIAS }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
./gradlew $MODULES
- name: Upload APKs (${{ matrix.chunk.number }})
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
if: "github.repository == 'extsup/extensions-source'"
with:
name: "individual-apks-${{ matrix.chunk.number }}"
path: "**/*.apk"
retention-days: 1
- name: Clean up CI files
run: rm signingkey.jks
publish:
name: Publish extension repo
needs: [prepare, build]
if: "github.repository == 'extsup/extensions-source'"
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Download APK artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
path: ~/apk-artifacts
- name: Set up JDK
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
with:
java-version: 17
distribution: temurin
- name: Checkout ori branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: ori
path: main
persist-credentials: false
- name: Create repo artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd main
python ./.github/scripts/move-built-apks.py
INSPECTOR_LINK="$(curl -s -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/keiyoushi/extensions-inspector/releases/latest" | jq -r '.assets[0].browser_download_url')"
curl -L "$INSPECTOR_LINK" -o ./Inspector.jar
java -jar ./Inspector.jar "repo/apk" "output.json" "tmp"
python ./.github/scripts/create-repo.py
- name: Checkout repo branch
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
repository: extsup/extensions
token: ${{ secrets.BOT_PAT }}
ref: repo
path: repo
persist-credentials: true
- name: Merge and deploy repo
env:
DELETE: ${{ needs.prepare.outputs.delete }}
run: |
cd repo
python ../main/.github/scripts/merge-repo.py "$DELETE"
../main/.github/scripts/commit-repo.sh