GitHub Action
Nextcloud push app to appstore
This Github Action automatically publishes a new app version in the Nextcloud appstore after you created a new Github release.
The following workflow can be automated when using this Github Action:
- Create a new release of your app in Github.
- Let a new Github Workflow be triggered which automates the following steps:
- Chechout the
tag
version of your new release. - Build a tarball for your app.
- Attach the tarball to the Github Release.
- 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).
- Chechout the
-
Register you app in the Nextcloud appstore like described here.
-
Paste the content of your app's private key into a new Github Secret named
APP_PRIVATE_KEY
. This key is later used for signing the new app version before uploading it to the appstore. -
For authentication against the Nextcloud appstore you can use one of the following approaches:
- Token (recommended): create a new Github Secret for your Nextcloud appstore account token named
APPSTORE_TOKEN
. The token can be copied by logging into https://apps.nextcloud.com an then visiting My account -> API-Token. - Username & password: create two Github Secrets
APPSTORE_USERNAME
andAPPSTORE_PASSWORD
holding your personal login information for the Nextcloud appstore. Make sure this user is allowed to create new app releases for you app.
- Token (recommended): create a new Github Secret for your Nextcloud appstore account token named
-
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:
- https://github.com/nextcloud/files_photospheres/blob/master/Makefile (without code signing)
- https://github.com/nextcloud/spreed/blob/b5198c2d0d9cdc2c7c0e410867d2ec84336e23a6/Makefile (with code signing)
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
directory of this repository.
Example without code signing
The following example shows how you can use this Github Action with your Nextcloud Appstore token after a new Github Release was created:
name: Build and publish app release
on:
release:
types: [published]
env:
APP_NAME: workflow_ocr
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ${{ env.APP_NAME }}
- name: Run build
run: cd ${{ env.APP_NAME }} && make appstore
- name: Upload app tarball to release
uses: svenstaro/upload-release-action@v2
id: attach_to_release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.APP_NAME }}/build/artifacts/appstore/${{ env.APP_NAME }}.tar.gz
asset_name: ${{ env.APP_NAME }}.tar.gz
tag: ${{ github.ref }}
overwrite: true
- name: Upload app to Nextcloud appstore
uses: R0Wi/nextcloud-appstore-push-action@v1
with:
app_name: ${{ env.APP_NAME }}
appstore_token: ${{ secrets.APPSTORE_TOKEN }}
download_url: ${{ steps.attach_to_release.outputs.browser_download_url }}
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
nightly: ${{ github.event.release.prerelease }}
Name | Description | Default | Possible values | Required |
---|---|---|---|---|
app_name |
The id of your Nextcloud app | - | string |
true |
appstore_token |
A valid access token to upload a new version of your app into Nextcloud appstore | - | string |
false * |
appstore_username |
Username for Nextcloud appstore | - | string |
false * |
appstore_password |
Password for Nextcloud appstore | - | string |
false * |
download_url |
The download url of you app tarball | - | string |
true |
app_private_key |
The private key string of you app to sign the new release. Usually stored in Github Secrets | - | string |
true |
nightly |
Controls if the app will be published as nightly into the Nextcloud appstore | false |
true , false |
false |
*Either
appstore_token
orappstore_username
andappstore_password
must be set.
There are currently no output variables.