Align release tags with SQLCipher upstream #2
This file contains hidden or 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: build | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| android: | |
| runs-on: ubuntu-latest | |
| env: | |
| ANDROID_NDK_VERSION: 26.3.11579264 | |
| ANDROID_NDK_HOME: ${{ github.workspace }}/android-sdk/ndk/26.3.11579264 | |
| ANDROID_HOME: ${{ github.workspace }}/android-sdk | |
| USE_GITHUB_TAG_AS_SQLCIPHER_REF: "1" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Android command line tools | |
| run: | | |
| mkdir -p "$ANDROID_HOME/cmdline-tools" | |
| curl -L --fail -o /tmp/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip | |
| unzip -q /tmp/cmdline-tools.zip -d "$ANDROID_HOME/cmdline-tools" | |
| mv "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/latest" | |
| yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses >/dev/null | |
| "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "ndk;$ANDROID_NDK_VERSION" | |
| - name: Build | |
| run: make package | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sqlcipher-android-cli | |
| path: dist/* | |
| - name: Publish GitHub release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release create "${GITHUB_REF_NAME}" dist/* --title "${GITHUB_REF_NAME}" --notes "SQLCipher Android CLI build from sqlcipher/sqlcipher@${GITHUB_REF_NAME}." |