|
2 | 2 | This Github Action automatically publishes a new app version in the Nextcloud appstore after you created a new Github release. |
3 | 3 |
|
4 | 4 | ## Workflow |
5 | | -The following workflow will be automated by this Action: |
| 5 | +The following workflow can be automated when using this Github Action: |
6 | 6 |
|
7 | | -1. Develop your app. |
8 | | -2. Create a new [release](https://docs.github.com/en/github/administering-a-repository/managing-releases-in-a-repository). |
9 | | -3. Let a new Github Workflow be triggered which automates the following steps: |
| 7 | +1. Create a new [release](https://docs.github.com/en/github/administering-a-repository/managing-releases-in-a-repository) of your app in Github. |
| 8 | +2. Let a new Github Workflow be triggered which automates the following steps: |
10 | 9 | - Chechout the `tag` version of your new release. |
11 | 10 | - Build a tarball for your app. |
12 | 11 | - Attach the tarball to the Github Release. |
13 | | - - Upload a new app version into the Nextcloud appstore referencing your attached tarball. This includes creating a signature and authenticating against Nextcloud's appstore via token. |
| 12 | + - Upload a new app version into the Nextcloud appstore referencing your attached tarball. This includes creating a signature and authenticating against Nextcloud's appstore via token (or username and password). |
14 | 13 |
|
15 | 14 | ## Prerequisites |
16 | 15 | 1. **Register** you app in the Nextcloud appstore like described [here](https://nextcloudappstore.readthedocs.io/en/latest/developer.html). |
17 | | -2. Paste the content of your app's **private key into a new [Github Secret](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets)** of your app's repository (e.g. with the key `APP_PRIVATE_KEY`). This key is later used for signing the new app version before uploading it to the appstore. |
18 | | -3. Create a new [Github Secret](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) for your **Nextcloud appstore account [token](https://nextcloudappstore.readthedocs.io/en/latest/restapi.html#authentication)** (e.g. with the key `APPSTORE_TOKEN`). The token can be copied by logging into https://apps.nextcloud.com an then visiting *My account -> API-Token*. |
19 | | -4. Make sure you are able to build a tarball for your app inside of Github actions. This could be achieved by using an appropriate [`Makefile`](https://github.com/nextcloud/files_photospheres/blob/master/Makefile). |
| 16 | +2. Paste the content of your app's **private key into a new [Github Secret](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets)** named `APP_PRIVATE_KEY`. This key is later used for signing the new app version before uploading it to the appstore. |
| 17 | + |
| 18 | +3. For **authentication** against the Nextcloud appstore you can use one of the following approaches: |
| 19 | + 1. **Token** (recommended): create a new [Github Secret](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) for your Nextcloud appstore account [token](https://nextcloudappstore.readthedocs.io/en/latest/restapi.html#authentication) named `APPSTORE_TOKEN`. The token can be copied by logging into https://apps.nextcloud.com an then visiting *My account -> API-Token*. |
| 20 | + 2. **Username & password**: create two [Github Secrets](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) `APPSTORE_USERNAME` and `APPSTORE_PASSWORD` holding your personal login information for the [Nextcloud appstore](https://apps.nextcloud.com). Make sure this user is allowed to create new app releases for you app. |
| 21 | +4. Make sure you are able to build a tarball for your app inside of Github actions. This could be achieved by using an appropriate `Makefile`. Here are two examples: |
| 22 | +* https://github.com/nextcloud/files_photospheres/blob/master/Makefile (without [code signing](https://docs.nextcloud.com/server/latest/admin_manual/issues/code_signing.html)) |
| 23 | +* https://github.com/nextcloud/spreed/blob/b5198c2d0d9cdc2c7c0e410867d2ec84336e23a6/Makefile (with [code signing](https://docs.nextcloud.com/server/latest/admin_manual/issues/code_signing.html)) |
20 | 24 |
|
21 | 25 | ## Usage |
22 | | -### Example |
23 | | -The following example shows how you can use this Github Action after a new Github Release was created: |
| 26 | +In general you'll have to create a new `.yml`-file in your app's repository inside of `.github/workflows` (for example `.github/workflows/build_release.yml`) to use this Github Action. The following sections list a few useful examples on how you can combine this Action with others to automate your workflow. All samples can also be found in the [`examples`](examples) directory of this repository. |
| 27 | + |
| 28 | +### Example without [code signing](https://docs.nextcloud.com/server/latest/admin_manual/issues/code_signing.html) |
| 29 | +The following example shows how you can use this Github Action with your Nextcloud Appstore token after a new Github Release was created: |
24 | 30 |
|
25 | 31 | ```yaml |
26 | 32 | name: Build and publish app release |
@@ -62,13 +68,18 @@ jobs: |
62 | 68 |
|
63 | 69 | ``` |
64 | 70 |
|
65 | | -> You'll have to store this file inside of your app's repository. For example under `.github/workflows/build_release.yml`. |
66 | | -
|
67 | 71 | ### Input variables |
68 | | -* `app_name`: The id of your Nextcloud app *(required)* |
69 | | -* `appstore_token`: A valid access token to upload a new version of your app into Nextcloud appstore *(required)* |
70 | | -* `download_url`: The download url of you app tarball *(required)* |
71 | | -* `app_private_key`: The private key string of you app to sign the new release. Usually stored in Github Secrets *(required)* |
72 | | -* `nightly`: Controls if the app will be published as nightly into the Nextcloud appstore *(optional, default = `false`)* |
| 72 | +| Name | Description | Default | Possible values | Required | |
| 73 | +|-------------------|---------------------------------------------------------------------------------------------|---------|-----------------|----------| |
| 74 | +| `app_name` | The id of your Nextcloud app | - | `string` | `true` | |
| 75 | +| `appstore_token` | A valid access token to upload a new version of your app into Nextcloud appstore | - | `string` | `false`* | |
| 76 | +| `appstore_username` | Username for Nextcloud appstore | - | `string` | `false`* | |
| 77 | +| `appstore_password` | Password for Nextcloud appstore | - | `string` | `false`* | |
| 78 | +| `download_url` | The download url of you app tarball | - | `string` | `true` | |
| 79 | +| `app_private_key` | The private key string of you app to sign the new release. Usually stored in Github Secrets | - | `string` | `true` | |
| 80 | +| `nightly` | Controls if the app will be published as nightly into the Nextcloud appstore | `false` | `true`, `false` | `false` | |
| 81 | + |
| 82 | +> *Either `appstore_token` or `appstore_username` **and** `appstore_password` must be set. |
| 83 | +
|
73 | 84 | ### Output variables |
74 | 85 | There are currently no output variables. |
0 commit comments