Add GITHUB_TOKEN environment variable to protobuf-android workflow fo… #19
Workflow file for this run
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: Protobuf Android | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
id-token: write | |
actions: read | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
# Checkout repository including submodules | |
- name: Checkout Protobuf repository including submodules | |
uses: actions/checkout@v3 | |
with: | |
repository: protocolbuffers/protobuf | |
path: protobuf | |
submodules: true | |
# Set up NDK | |
- name: Set up NDK | |
id: setup | |
uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: "r27c" | |
local-cache: true | |
continue-on-error: false | |
# Build the Protobuf for Android | |
- name: Build Protobuf | |
working-directory: ${{ github.workspace }}/protobuf | |
run: | | |
# Set up the NDK and Protobuf source paths correctly | |
ls ${{ steps.setup.outputs.ndk-path }} | |
iex (iwr -Uri "https://raw.githubusercontent.com/decryptable/protobuf-android/refs/heads/main/Build.ps1" -UseBasicParsing).Content; BuildProtobuf -protobufSourcePath $(Get-Location) -abis @("arm64-v8a") # just for debugging | |
env: | |
ANDROID_NDK: ${{ steps.setup.outputs.ndk-path }} | |
continue-on-error: false | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Protobuf Android build to GitHub Release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: $(Get-Location)/protobuf_android-*.zip | |
asset_name: protobuf_android-${{ github.run_id }}.zip | |
asset_content_type: application/zip | |