-
Notifications
You must be signed in to change notification settings - Fork 2
split shared action code #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e6b3099
8822b8c
c9ad817
1a6a5d8
3af340a
65e4d69
1692a78
1fd6fc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: Setup Android App Build | ||
| description: Extended setup for Android app build jobs. | ||
|
|
||
| inputs: | ||
| checkout-token: | ||
| description: 'Token used for checkout.' | ||
| required: true | ||
| use-git-lfs: | ||
| description: 'Use git lfs during repository checkout.' | ||
| required: true | ||
| jdk: | ||
| description: 'The JDK version to use.' | ||
| required: true | ||
| setup-rust: | ||
| description: 'Whether to set up the Rust toolchain.' | ||
| required: true | ||
| flavor: | ||
| description: 'The build flavor. Used to compute flavor_capitalized.' | ||
| required: true | ||
| app-module: | ||
|
M-Wong marked this conversation as resolved.
|
||
| description: 'The Gradle app module (e.g. "app" or "android:androidApp").' | ||
| required: true | ||
|
|
||
| outputs: | ||
| flavor_capitalized: | ||
| description: 'The flavor name with the first letter capitalized.' | ||
| value: ${{ steps.vars.outputs.flavor_capitalized }} | ||
| app_module_path: | ||
| description: 'The app module path with colons replaced by slashes.' | ||
| value: ${{ steps.vars.outputs.app_module_path }} | ||
| build_id: | ||
| description: 'A random UUID for this build.' | ||
| value: ${{ steps.vars.outputs.build_id }} | ||
| build_number: | ||
| description: 'The GitHub run number.' | ||
| value: ${{ steps.vars.outputs.build_number }} | ||
| build_batch: | ||
| description: 'The GitHub run ID.' | ||
| value: ${{ steps.vars.outputs.build_batch }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Setup Android environment | ||
| uses: UbiqueInnovation/actions-android/.github/actions/android-base-setup@v2 | ||
| with: | ||
| checkout-token: ${{ inputs.checkout-token }} | ||
| use-git-lfs: ${{ inputs.use-git-lfs }} | ||
| jdk: ${{ inputs.jdk }} | ||
| setup-rust: ${{ inputs.setup-rust }} | ||
|
|
||
| - name: Set Build Variables | ||
| id: vars | ||
| shell: bash | ||
| run: | | ||
| flavor=${{ inputs.flavor }} | ||
| echo "flavor_capitalized=${flavor~}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| appModulePath=${{ inputs.app-module }} | ||
| appModulePath=${appModulePath//:/\/} | ||
| echo "app_module_path=$appModulePath" >> "$GITHUB_OUTPUT" | ||
|
|
||
| echo "build_id=$(cat /proc/sys/kernel/random/uuid)" >> "$GITHUB_OUTPUT" | ||
| echo "build_number=${{ github.run_number }}" >> "$GITHUB_OUTPUT" | ||
| echo "build_batch=${{ github.run_id }}" >> "$GITHUB_OUTPUT" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: Setup Android Environment | ||
| description: > | ||
| Base setup for Android CI jobs. Checks out the repository, installs zstd, | ||
| sets up a JDK, and optionally sets up the Rust toolchain. | ||
|
|
||
| inputs: | ||
| checkout-token: | ||
| description: 'Token used for checkout.' | ||
| required: true | ||
|
fbzli marked this conversation as resolved.
|
||
| use-git-lfs: | ||
| description: 'Use git lfs during repository checkout.' | ||
| required: true | ||
| jdk: | ||
| description: 'The JDK version to use.' | ||
| required: true | ||
| setup-rust: | ||
| description: 'Whether to set up the Rust toolchain.' | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6.0.2 | ||
| with: | ||
| token: ${{ inputs.checkout-token }} | ||
| submodules: 'recursive' | ||
| lfs: ${{ inputs.use-git-lfs }} | ||
| fetch-depth: 10 | ||
|
|
||
|
fbzli marked this conversation as resolved.
|
||
| - name: Set up JDK | ||
| uses: actions/setup-java@v5.2.0 | ||
| with: | ||
| distribution: 'zulu' | ||
| java-version: ${{ inputs.jdk }} | ||
|
|
||
| - name: Install zstd | ||
| shell: bash | ||
| run: sudo apt-get install -y zstd | ||
|
|
||
| - name: Setup Rust toolchain | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Würds Sinn machen das Prebuild Script als Teil von dieser Action zu haben?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ja. Und ich habe mir überlegt, das Script nicht als Input zu übergeben, sondern ein fixes File im Client-Repo unter
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bin nicht so Fan davon wenn die Action auf ein hardcodiertes Pre-Build Script versucht zu gehen. Lieber das Script als File-Pfad als Input nehmen (statt wie jetzt den effektiven Script Code als Input) |
||
| if: ${{ inputs.setup-rust == 'true' }} | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1.15.4 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: SSH Setup | ||
| description: > | ||
| Ensures ~/.ssh is a valid directory, loads the given private key via ssh-agent, | ||
| and adds the GitHub host key fingerprints to known_hosts. | ||
|
|
||
| inputs: | ||
| ssh-private-key: | ||
| description: 'The SSH private key to load into the ssh-agent.' | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Ensure ~/.ssh is a directory | ||
| shell: bash | ||
| run: | | ||
| if [ -e "$HOME/.ssh" ] && [ ! -d "$HOME/.ssh" ]; then | ||
| echo "~/.ssh exists but is not a directory. Deleting it..." | ||
| rm -f "$HOME/.ssh" | ||
| fi | ||
| mkdir -p "$HOME/.ssh" | ||
| chmod 700 "$HOME/.ssh" | ||
|
|
||
| - name: Add SSH Key | ||
| uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 | ||
| with: | ||
| ssh-private-key: ${{ inputs.ssh-private-key }} | ||
|
|
||
| - name: Add GitHub SSH keys to the known_hosts file | ||
| shell: bash | ||
| run: | | ||
| cat >> ~/.ssh/known_hosts <<EOF | ||
| github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl | ||
| github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg= | ||
| github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk= | ||
| EOF |
Uh oh!
There was an error while loading. Please reload this page.