Export Kotin Files #5
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
# This is a basic workflow to help you get started with Actions | ||
name: Generate Kotlin | ||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "gen-kotlin" | ||
gen-kotlin: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v4 | ||
# Runs a single command using the runners shell | ||
- name: Run generateProtos Task | ||
run: ./gradlew generateProtos | ||
export-files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Generate Protos | ||
run: ./gradlew generateProtos | ||
- name: Upload generated files | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: generated-kotlin-files | ||
path: build/generated/source/wire/*.kt | ||
- name: Push to separate repo (replace with your details) | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'ksharma/Kotlin-Proto' # Target repo | ||
token: ${{ secrets.TOKEN }} # Use secret for authentication | ||
# env: | ||
# GITHUB_PAT: ${{ secrets.TOKEN }} # Optional environment variable for PAT | ||
- name: Configure Git | ||
run: | | ||
git config user.name 'Karan Sharma' | ||
git config user.email '[email protected]' | ||
- name: Create a new branch | ||
run: git checkout -b kotlinfiles | ||
- name: Create Commit | ||
run: | | ||
# cd kotlin # Optional if artifacts are in a subdirectory | ||
git add . | ||
git commit -m "Add generated Kotlin files from main project" | ||
- name: Push changes to target repo | ||
run: git push origin ${{ steps.checkout-target-repo.outputs.branch }} |