Skip to content

Commit

Permalink
let's go
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
Julien Veyssier committed Jun 13, 2022
0 parents commit 1057d3b
Show file tree
Hide file tree
Showing 43 changed files with 24,828 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
globals: {
appVersion: true
},
parserOptions: {
requireConfigFile: false
},
extends: [
'@nextcloud'
],
rules: {
'jsdoc/require-jsdoc': 'off',
'jsdoc/tag-lines': 'off',
'vue/first-attribute-linebreak': 'off',
'import/extensions': 'off'
}
}
122 changes: 122 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
on:
push:
branches: [release]

name: Publish release

jobs:
build:
name: Build, upload and release in the appstore
environment: release
env:
APP_ID: integration_mattermost
runs-on: ubuntu-latest
steps:
- name: Use Node 14
uses: actions/setup-node@v2
with:
node-version: 14

- name: Set up npm
run: npm i -g npm@^7.0.0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: mbstring, intl, sqlite3
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
tools: php-cs-fixer, phpunit

- name: Checkout code
uses: actions/checkout@v2

- name: Get current tag
id: tag
run: |
git fetch --tags --force
tag=$(git tag -l --points-at HEAD)
vtag=$(echo $tag | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+" || echo "")
echo "##[set-output name=currenttag;]$vtag"
- name: Build project
if: ${{ startsWith( steps.tag.outputs.currenttag , 'v' ) }}
id: build_release
run: |
echo "##[set-output name=app_id;]$APP_ID"
echo "###### copy certificate"
mkdir -p ~/.nextcloud/certificates
echo "$APP_CRT" > ~/.nextcloud/certificates/${APP_ID}.crt
echo "$APP_KEY" > ~/.nextcloud/certificates/${APP_ID}.key
echo "###### install dependencies"
export DEBIAN_FRONTEND=noninteractive
sudo apt update -y
sudo apt install make openssl -y
echo "###### installing nextcloud"
mkdir ~/html
git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b master ~/html/nextcloud
sed -i $'s|if (substr($fullPath, 0, strlen($root) + 1) === $root . \'/\')|if (is_string($root) and substr($fullPath, 0, strlen($root) + 1) === $root . \'/\')|g' ~/html/nextcloud/lib/autoloader.php
cp -r $GITHUB_WORKSPACE ~/html/nextcloud/apps/${APP_ID}
php ~/html/nextcloud/occ maintenance:install --database "sqlite" --admin-user "admin" --admin-pass "password"
php ~/html/nextcloud/occ app:enable ${APP_ID}
php ~/html/nextcloud/occ maintenance:mode --off
cd ~/html/nextcloud/apps/${APP_ID}
echo "###### npm install"
npm ci
echo "###### npm run build"
npm run build
echo "###### make appstore"
tag=${{ steps.tag.outputs.currenttag }}
version=${tag/v/}
webserveruser=runner occ_dir=~/html/nextcloud version=$version make appstore
echo "##[set-output name=version;]$version"
env:
APP_CRT: ${{ secrets.APP_CRT }}
APP_KEY: ${{ secrets.APP_KEY }}

- name: Create Release
if: ${{ startsWith( steps.tag.outputs.currenttag , 'v' ) }}
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.currenttag }}
release_name: ${{ steps.tag.outputs.currenttag }}
draft: false
prerelease: false

- name: Upload Release Asset
if: ${{ startsWith( steps.tag.outputs.currenttag , 'v' ) }}
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/build/${{ steps.build_release.outputs.app_id }}-${{ steps.build_release.outputs.version }}.tar.gz
asset_name: ${{ steps.build_release.outputs.app_id }}-${{ steps.build_release.outputs.version }}.tar.gz
asset_content_type: application/gzip

- name: Publish normal release to appstore
if: ${{ startsWith( steps.tag.outputs.currenttag , 'v' ) && !endsWith( steps.tag.outputs.currenttag , 'nightly' ) }}
id: publish
run: |
SIGNATURE=$(cat /tmp/build/sign.txt | tr -d '\n')
VERSION=${{ steps.build_release.outputs.version }}
DOWNLOAD_URL=https://github.com/${{ github.repository }}/releases/download/v${VERSION}/${APP_ID}-${VERSION}.tar.gz
curl -X POST -H "Authorization: Token $APPSTORE_TOKEN" https://apps.nextcloud.com/api/v1/apps/releases -H "Content-Type: application/json" -d '{"download":"'${DOWNLOAD_URL}'", "signature": "'${SIGNATURE}'"}'
env:
APPSTORE_TOKEN: ${{ secrets.APPSTORE_TOKEN }}

- name: Publish nightly release to appstore
if: ${{ startsWith( steps.tag.outputs.currenttag , 'v' ) && endsWith( steps.tag.outputs.currenttag , 'nightly' ) }}
id: nightly
run: |
SIGNATURE=$(cat /tmp/build/sign.txt | tr -d '\n')
VERSION=${{ steps.build_release.outputs.version }}
DOWNLOAD_URL=https://github.com/${{ github.repository }}/releases/download/v${VERSION}/${APP_ID}-${VERSION}.tar.gz
curl -X POST -H "Authorization: Token $APPSTORE_TOKEN" https://apps.nextcloud.com/api/v1/apps/releases -H "Content-Type: application/json" -d '{"download":"'${DOWNLOAD_URL}'", "signature": "'${SIGNATURE}'", "nightly": true}'
env:
APPSTORE_TOKEN: ${{ secrets.APPSTORE_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/js/
.code-workspace
.DS_Store
.idea/
.vscode/
.vscode-upload.json
.*.sw*
node_modules
2 changes: 2 additions & 0 deletions .l10nignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# compiled vue templates
js/
9 changes: 9 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[main]
host = https://www.transifex.com
lang_map = bg_BG: bg, cs_CZ: cs, fi_FI: fi, hu_HU: hu, nb_NO: nb, sk_SK: sk, th_TH: th, ja_JP: ja

[nextcloud.integration_mattermost]
file_filter = translationfiles/<lang>/integration_mattermost.po
source_file = translationfiles/templates/integration_mattermost.pot
source_lang = en
type = PO
4 changes: 4 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Authors

* Julien Veyssier <[email protected]> (Developper)

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## 0.0.1 – 2022-06-13
### Added
* the app
Loading

0 comments on commit 1057d3b

Please sign in to comment.