Skip to content

Commit

Permalink
📝 update README & action.yml (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
igotinfected authored Jan 10, 2022
1 parent 126e8ce commit e248b79
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 8 deletions.
94 changes: 93 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,94 @@
# build-and-sign-monogame-android
Build and sign your MonoGame Android project for release.

This action allows you to build and sign your MonoGame Android project for release.

The action sets up `dotnet`, `msbuild`, and the `mgcb` build tool.
It then builds the `Content` resources using `mgcb`, then builds and signs the
game using `msbuild`, and finally uploads both the signed and unsigned `aab`s
as artifacts to the workflow.

If you're looking for an action that only builds your MonoGame project, check
out [build-monogame](https://github.com/marketplace/actions/build-monogame-project).

# Usage

```yml
name: Generate signed aab for release

on:
pull_request:
branches: [master]

# allow running this workflow manually
workflow_dispatch:

jobs:
generate-signed-aab:
runs-on: windows-latest

steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Build Android project and sign generated aab
uses: igotinfected-ci/build-and-sign-monogame-android@v1
with:
solution-path: '${{ github.workspace }}\Project\Project.sln'
content-mgcb-path: '${{ github.workspace }}\Project\Android\Content'
content-mgcb-platform: "Android"
project-path: '${{ github.workspace }}\Project\Android'
csproj-path: '${{ github.workspace }}\Project\Android\Android.csproj'
build-target: "PackageForAndroid"
build-configuration: "Release"
```
This action uploads the generated `aab`s as artifacts (`name: signed-aab`) to the workflow, meaning
you can then use [download-artifact](https://github.com/marketplace/actions/download-a-build-artifact)
to download them via a second job in the workflow.

Retrieving the uploaded artifact:

```yml
name: Generate signed aab for release and do something with it
on:
pull_request:
branches: [master]
# allow running this workflow manually
workflow_dispatch:
jobs:
generate-signed-aab:
runs-on: windows-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Build Android project and sign generated aab
uses: igotinfected-ci/build-and-sign-monogame-android@v1
with:
solution-path: '${{ github.workspace }}\Project\Project.sln'
content-mgcb-path: '${{ github.workspace }}\Project\Android\Content'
content-mgcb-platform: "Android"
project-path: '${{ github.workspace }}\Project\Android'
csproj-path: '${{ github.workspace }}\Project\Android\Android.csproj'
build-target: "PackageForAndroid"
build-configuration: "Release"
do-something-with-it:
runs-on: windows-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: signed-aab
# artifact in current working directory now as a zip file containing
# both the unsigned and signed aabs
```

# License

The scripts and documentation in this project are released under the [MIT License](LICENSE)
33 changes: 26 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Build and sign MonoGame Android project"

author: "igotinfected (Jason Rebelo Neves)"

description: "Build and sign your MonoGame Android projects for release with this action."
description: "Build and sign your MonoGame Android projects with this action. Useful for creating release artifacts."

inputs:
dotnet-version:
Expand All @@ -13,33 +13,52 @@ inputs:
description: "Path to the `.sln`. Used to restore NuGet packages from."
required: true
content-mgcb-path:
description: "Path to the `Content.mgcb` file for the Android project. Used to build the MonoGame content files. Note: this may not be required in future releases."
description: >
Path to the `Content.mgcb` file for the Android project.
Used to build the MonoGame content files.
Note: this may not be required in future releases.
required: true
project-path:
description: "Path to the Android project."
required: true
csproj-path:
description: "Path to the Android `.csproj` to build with. This is passed to `msbuild` to initiate the build."
description: >
Path to the Android `.csproj` to build with.
This is passed to `msbuild` to initiate the build.
required: true
build-configuration:
description: "The `msbuild` build configuration to use. Defaults to `Release`."
required: true
default: "Release"
package-format:
description: "The Android package format to use. Should be `aab` for Play Store distribution. Defaults to `aab`."
description: >
The Android package format to use. Should be `aab` for Play Store distribution.
Defaults to `aab`.
required: true
default: "aab"
keystore:
description: "Base64 encoded string of the keystore to use for signing. This value should be stored as a GitHub secret."
description: >
Base64 encoded string of the keystore to use for signing.
Note: this value should be stored as a GitHub secret.
required: true
keystore-password:
description: "Password for the keystore. This value should be stored as a GitHub secret."
description: >
Password for the keystore.
Note: this value should be stored as a GitHub secret.
required: true
key-alias:
description: "Alias of the key to use from the keystore."
required: true
key-password:
description: "Password for the key. This value should be stored as a GitHub secret."
description: >
Password for the key.
Note: this value should be stored as a GitHub secret.
required: true

runs:
Expand Down

0 comments on commit e248b79

Please sign in to comment.