diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..8ddc0dbf --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,42 @@ +name: main +on: push +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Variables + id: variables + run: echo ::set-output name=version::$(git describe --tags --always) + - name: Java + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Secrets + run: echo "${STORE_DATA}" | base64 --decode > store.jks + env: + STORE_DATA: ${{ secrets.STORE_DATA }} + - name: Build + uses: eskatos/gradle-command-action@v1 + env: + STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + with: + arguments: assemble + gradle-version: 6.7.1 + - name: Move + run: mv app/build/outputs/apk/release/*.apk gelli-release-${version}.apk + env: + version: ${{ steps.variables.outputs.version }} + - name: Publish + if: startsWith(github.ref, 'refs/tags') + uses: ncipollo/release-action@v1 + with: + artifacts: '*.apk' + tag: ${{ steps.variables.outputs.version }} + commit: ${{ github.sha }} + token: ${{ github.token }}