From 78db18a7ee4e81b9c0a5e8a85c1b86add853eb60 Mon Sep 17 00:00:00 2001 From: 7c00 Date: Mon, 13 Feb 2023 15:47:46 +0800 Subject: [PATCH] Add build docs action --- .github/issue_template.md | 12 ------------ .github/workflows/build-docs.yml | 16 ++++++++++++++++ .github/workflows/release.yml | 33 ++++++++++++++------------------ 3 files changed, 30 insertions(+), 31 deletions(-) delete mode 100644 .github/issue_template.md create mode 100644 .github/workflows/build-docs.yml diff --git a/.github/issue_template.md b/.github/issue_template.md deleted file mode 100644 index 20a78daf..00000000 --- a/.github/issue_template.md +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 00000000..a731d2fe --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,16 @@ +name: build-docs +on: + push: + branches: [main] +jobs: + build-docs: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + - run: npm i typescript typedoc + - run: npx typedoc --out docs/api --skipErrorChecking src + - uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: docs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d8936e6..59cadd13 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,36 +6,31 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: npm pack - run: npx react-native init example - working-directory: ../ - - run: cp index.js ../example/ - - run: cp -r example ../example/ - - run: npm i ../react-native-amap3d/react-native-amap3d-0.0.0.tgz - working-directory: ../example + - run: cp index.js example/ + - run: cp -r example example/ + - run: npm i ../react-native-amap3d-0.0.0.tgz + working-directory: example - run: npm i @react-native-picker/picker @react-navigation/native @react-navigation/native-stack react-native-safe-area-context react-native-screens - working-directory: ../example + working-directory: example - run: sed -i.backup -r 's/(enableSeparateBuildPerCPUArchitecture = )false/\1true/' build.gradle - working-directory: ../example/android/app + working-directory: example/android/app - run: ./gradlew assembleRelease - working-directory: ../example/android - - uses: bruceadams/get-release@v1.2.3 + working-directory: example/android + - uses: bruceadams/get-release@v1.3.2 id: release env: GITHUB_TOKEN: ${{ github.token }} - - uses: actions/setup-node@v2 + - uses: svenstaro/upload-release-action@v2 + with: + file: example/android/app/build/outputs/apk/release/app-arm64-v8a-release.apk + asset_name: example.apk + - uses: actions/setup-node@v3 with: registry-url: "https://registry.npmjs.org" - run: npm version ${{ steps.release.outputs.tag_name }} --no-git-tag-version - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - upload_url: ${{ steps.release.outputs.upload_url }} - asset_path: ../example/android/app/build/outputs/apk/release/app-arm64-v8a-release.apk - asset_name: example.apk - asset_content_type: application/vnd.android.package-archive