Skip to content

Commit

Permalink
Build sample app and upload to latest release.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikeelde committed Jan 12, 2024
1 parent 415aec4 commit 174363e
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: minor
template: |
## Changes
$CHANGES
37 changes: 36 additions & 1 deletion .github/workflows/app-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
fetch-depth: '0'

- name:
- name: "setup secrets"
run: |
echo "${{ secrets.KEYSTORE_PROPERTIES }}" > keystore.properties.asc
gpg -d --passphrase "${{ secrets.GPG_ENCRYPTION_KEY }}" --batch keystore.properties.asc > keystore.properties
Expand Down Expand Up @@ -51,9 +51,44 @@ jobs:
if: github.repository == 'erikeelde/toggles'
run: ./gradlew :toggles-app:publishReleaseBundle

- name: Build sample application
if: github.repository == 'erikeelde/toggles'
run: ./gradlew :toggles-sample:assembleRelease

- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: Apks
path: '**/build/outputs/*'
retention-days: 14

- uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- 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/release/toggles-sample-release-unsigned.apk';
const content_type = 'application/vnd.android.package-archive';
const release_id = '136748606';
const response = await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release_id,
name: 'toggles-sample.apk',
data: fs.readFileSync(path),
headers: {
'content-type': content_type,
'content-length': fs.statSync(path).size
}
});
console.log(response);
23 changes: 23 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release Drafter

on:
push:
branches:
- main

permissions:
contents: read

jobs:
update_release_draft:
permissions:
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 174363e

Please sign in to comment.