Update NEW_RELEASE.yml #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Releases | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- "*" | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
linux: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
check-latest: true | |
- name: Setup Buildtools | |
# You may pin to the exact commit or the version. | |
# uses: buildtool/setup-buildtools-action@e081b64bf57ab25b64762e358f8a0dadd15500c6 | |
uses: buildtool/setup-buildtools-action@v1.0.0 | |
- name: Setup Android NDK | |
# You may pin to the exact commit or the version. | |
# uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410 | |
uses: nttld/setup-ndk@v1.5.0 | |
with: | |
# Exact version to use | |
ndk-version: r26d | |
# Add installation directory to the PATH | |
#- name: Install latest build tools | |
# run: | | |
# echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "build-tools;33.0.1" --sdk_root=${ANDROID_SDK_ROOT} | |
#- name: Install NDK | |
# run: | | |
# echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;25.2.9519653" --sdk_root=${ANDROID_SDK_ROOT} | |
- name: Gradle Build | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: assembleDebug | |
gradle-home-cache-cleanup: true | |
- name: Uploading Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
path: /home/runner/work/AccA-release/AccA-release/app/build/outputs/apk/debug/ | |
name: apk | |
- name: Create Release | |
uses: actions/github-script@v3 | |
with: | |
github-token: ${{secrets.FORBD}} | |
script: | | |
console.log('environment', process.versions); | |
const fs = require('fs').promises; | |
const { repo: { owner, repo }, sha } = context; | |
console.log({ owner, repo, sha }); | |
const release = await github.repos.createRelease({ | |
owner, repo, | |
tag_name: process.env.GITHUB_REF, | |
draft: true, | |
target_commitish: sha | |
}); | |
console.log('created release', { release }); | |
for (let file of await fs.readdir('.')) { | |
// do whatever filtering you want here, I'm just uploading all the files | |
console.log('uploading', file); | |
await github.repos.uploadReleaseAsset({ | |
owner, repo, | |
release_id: release.data.id, | |
name: file, | |
data: await fs.readFile(`./${file}`) | |
}); | |
} | |
#- name: Releases | |
# uses: softprops/action-gh-release@v1 | |
# with: | |
# body: Bump Version | |
# files: | | |
# /home/runner/work/AccA-release/AccA-release/app/build/outputs/apk/debug/ | |
# tag_name: release |