From 0c3a9446d6bd72e8164525d8e2964693afae7aa3 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Mon, 7 Sep 2020 08:21:10 +0200 Subject: [PATCH] Github release https://github.com/actions/upload-release-asset/issues/28#issuecomment-617208601 --- .github/workflows/Android-CI-release.yml | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/Android-CI-release.yml diff --git a/.github/workflows/Android-CI-release.yml b/.github/workflows/Android-CI-release.yml new file mode 100644 index 000000000..e8e4a00ba --- /dev/null +++ b/.github/workflows/Android-CI-release.yml @@ -0,0 +1,35 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + build: + name: Publish release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.2.0 + with: + fetch-depth: 0 + - name: Install JDK ${{ matrix.java_version }} + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Install Android SDK + uses: malinskiy/action-android/install-sdk@release/0.0.7 + - name: Build project + run: ./gradlew clean build + env: + TAG_VERSION: ${{ github.ref }} + - run: | + assetsAAR=$(find . -name *release.aar | while read -r asset ; do echo "-a $asset" ; done) + VERSION=$(echo $TAG_VERSION | cut -d'/' -f3) + assetsJAR=$(find . -name IOIO*${VERSION}.jar | while read -r asset ; do echo "-a $asset" ; done) + tag_name="${GITHUB_REF##*/}" + hub release create ${assetsAAR} ${assetsJAR} -m "$tag_name" "$tag_name" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG_VERSION: ${{ github.ref }}