Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
erikeelde committed Jan 12, 2024
1 parent 8ae2db3 commit 338af12
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions .github/workflows/app-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,16 @@ jobs:
# if: github.repository == 'erikeelde/toggles'
# run: ./gradlew :toggles-sample:assembleDebug

- name: Upload Release Asset
uses: actions/github-script@v7
- name: Upload an Asset in GitHub Release
uses: "actions/github-script@v6"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
const fs = require('fs');
//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 { 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,
const fs = require('fs').promises;
await github.rest.repos.uploadReleaseAsset({
name: 'README.md',
data: fs.readFileSync(path),
headers: {
'content-type': content_type,
'content-length': fs.statSync(path).size
}
owner: context.repo.owner,
repo: context.repo.repo,
release_id: 'v1.03.00',
data: await fs.readFile('./README.md') # The file to upload.
});

console.log(response);

0 comments on commit 338af12

Please sign in to comment.