Skip to content

Commit

Permalink
Build sample app and upload to latest release 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikeelde committed Jan 12, 2024
1 parent cd29852 commit 8ae2db3
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/app-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,34 @@ 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
with:
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);

0 comments on commit 8ae2db3

Please sign in to comment.