diff --git a/.github/workflows/app-release.yml b/.github/workflows/app-release.yml index c245a039..5ad531b5 100644 --- a/.github/workflows/app-release.yml +++ b/.github/workflows/app-release.yml @@ -44,9 +44,9 @@ jobs: - name: Setup Gradle uses: gradle/gradle-build-action@v2 - - name: Build sample application - if: github.repository == 'erikeelde/toggles' - run: ./gradlew :toggles-sample:assembleDebug +# - name: Build sample application +# if: github.repository == 'erikeelde/toggles' +# run: ./gradlew :toggles-sample:assembleDebug - name: Upload Release Asset uses: actions/github-script@v7 @@ -54,20 +54,24 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const fs = require('fs'); - const path = 'toggles-sample/build/outputs/apk/debug/toggles-sample-debug.apk'; + //const path = 'toggles-sample/build/outputs/apk/debug/toggles-sample-debug.apk'; + const path = 'README.md'; const content_type = 'application/vnd.android.package-archive'; const release_id = 'v1.03.00'; - - const response = await github.context.repos.uploadReleaseAsset({ - owner: context.repo.owner, - repo: context.repo.repo, + + const { Octokit } = require("@octokit/rest"); + const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN }); + + const response = await octokit.repos.uploadReleaseAsset({ + owner: process.env.GITHUB_REPOSITORY.split("/")[0], + repo: process.env.GITHUB_REPOSITORY.split("/")[1], release_id: release_id, - name: 'toggles-sample-debug.apk', + name: 'README.md', data: fs.readFileSync(path), headers: { 'content-type': content_type, 'content-length': fs.statSync(path).size } }); - + console.log(response);