nextcloud-swarm-plugin/.github/workflows/release.yml

82 lines
2.6 KiB
YAML

name: Release
on:
release:
types: [released]
env:
APP_NAME: files_external_ethswarm
CERT_DIRECTORY: $HOME/.nextcloud/certificates
jobs:
release:
runs-on: ubuntu-latest
name: Release new version
steps:
- name: Set up PHP
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.2"
tools: composer
- name: Checkout NC server
uses: actions/checkout@v2
with:
repository: nextcloud/server
ref: "master"
- name: Checkout NC submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Checkout app
uses: actions/checkout@v2
with:
path: ${{ env.APP_NAME }}
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.2
id: versions
with:
path: ./${{ env.APP_NAME }}/
fallbackNode: "^14"
fallbackNpm: "^7"
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
- name: Run build
run: |
mkdir -p ${{ env.CERT_DIRECTORY }}
echo "${{ secrets.APP_PRIVATE_KEY }}" > ${{ env.CERT_DIRECTORY }}/${{ env.APP_NAME }}.key
echo "${{ secrets.APP_CERT }}" > ${{ env.CERT_DIRECTORY }}/${{ env.APP_NAME }}.crt
cd ${{ env.APP_NAME }}
make appstore
rm -rf ${{ env.CERT_DIRECTORY }}
- name: Upload tarball to release
uses: svenstaro/upload-release-action@v2
id: attach_to_release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.APP_NAME }}/build/${{ 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 }}