diff --git a/.drone.star b/.drone.star index 9b08cdb..38683c4 100644 --- a/.drone.star +++ b/.drone.star @@ -1,14 +1,19 @@ def main(ctx): before = [ + tests(ctx), changelog(ctx), website(ctx), ] + stages = [ + release(ctx), + ] + after = [ notify(), ] - return before + after + return before + stages + after def changelog(ctx): repo_slug = ctx.build.source_repo if ctx.build.source_repo else ctx.repo.slug @@ -46,10 +51,10 @@ def changelog(ctx): }, { 'name': 'generate', - 'image': 'webhippie/golang:1.13', + 'image': 'toolhippie/calens:latest', 'pull': 'always', 'commands': [ - 'make changelog', + 'calens >| CHANGELOG.md', ], }, { @@ -219,4 +224,135 @@ def notify(): 'failure' ] }, - } \ No newline at end of file + } + +def tests(ctx): + return { + 'kind': 'pipeline', + 'type': 'docker', + 'name': 'tests', + 'platform': { + 'os': 'linux', + 'arch': 'amd64', + }, + 'steps': [ + { + 'name': 'install', + 'image': 'owncloudci/nodejs:11', + 'pull': 'always', + 'commands': [ + 'yarn install --frozen-lockfile', + ], + }, + { + 'name': 'lint', + 'image': 'owncloudci/nodejs:11', + 'pull': 'always', + 'commands': [ + 'yarn lint', + ], + }, + { + 'name': 'build', + 'image': 'owncloudci/nodejs:11', + 'pull': 'always', + 'commands': [ + 'yarn build', + ], + }, + ], + 'trigger': { + 'ref': [ + 'refs/heads/master', + 'refs/tags/**', + 'refs/pull/**', + ], + }, + } + +def release(ctx): + return { + 'kind': 'pipeline', + 'type': 'docker', + 'name': 'release', + 'platform': { + 'os': 'linux', + 'arch': 'amd64', + }, + 'steps': [ + { + 'name': 'build', + 'image': 'owncloudci/nodejs:11', + 'pull': 'always', + 'commands': [ + 'yarn install --frozen-lockfile', + 'yarn build' + ], + 'when': { + 'ref': [ + 'refs/tags/**', + ], + }, + }, + { + 'name': 'changelog', + 'image': 'toolhippie/calens:latest', + 'pull': 'always', + 'commands': [ + 'calens --version %s -o dist/CHANGELOG.md' % ctx.build.ref.replace("refs/tags/v", "").split("-")[0], + ], + 'when': { + 'ref': [ + 'refs/tags/**', + ], + }, + }, + { + 'name': 'publish-github', + 'image': 'plugins/github-release:latest', + 'pull': 'always', + 'settings': { + 'api_key': { + 'from_secret': 'github_token', + }, + 'title': ctx.build.ref.replace("refs/tags/v", ""), + 'note': 'dist/CHANGELOG.md', + 'overwrite': True, + }, + 'when': { + 'ref': [ + 'refs/tags/**', + ], + }, + }, + { + 'name': 'publish-npm', + 'image': 'plugins/npm:latest', + 'pull': 'always', + 'settings': { + 'username': { + 'from_secret': 'npm_username', + }, + 'email': { + 'from_secret': 'npm_email', + }, + 'token': { + 'from_secret': 'npm_token', + }, + }, + 'when': { + 'ref': [ + 'refs/tags/**', + ], + }, + }, + ], + 'depends_on': [ + 'tests' + ], + 'trigger': { + 'ref': [ + 'refs/tags/**', + ], + }, + } diff --git a/package.json b/package.json index 101c1fd..b54ee5d 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,34 @@ { - "name": "file-picker", + "name": "@owncloud/file-picker", "version": "0.1.0", "author": "ownclouders ", + "description": "Easily integrate ownCloud into your existing products", + "type": "module", + "module": "dist/file-picker.js", + "main": "dist/file-picker.js", + "unpkg": "dist/file-picker.min.js", + "repository": { + "type": "git", + "url": "git+https://github.com/owncloud/file-picker.git" + }, + "keywords": [ + "vue", + "vuejs", + "file", + "picker", + "ocis", + "owncloud", + "location", + "picker" + ], + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/owncloud/file-picker/issues" + }, + "homepage": "https://owncloud.github.io/integration/file_picker", "scripts": { "serve": "vue-cli-service serve", - "build": "vue-cli-service build --target wc --name file-picker", + "build": "vue-cli-service build --target wc --name file-picker && rm ./dist/demo.html", "test:unit": "vue-cli-service test:unit", "lint": "vue-cli-service lint" },