Skip to content

Commit

Permalink
foo
Browse files Browse the repository at this point in the history
  • Loading branch information
dschmidt committed Feb 6, 2023
1 parent b756333 commit 6685ea3
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 48 deletions.
147 changes: 100 additions & 47 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -1861,54 +1861,107 @@ def buildDockerImage():
},
}]

web_publish_npm_packages = ["tsconfig"]
web_publish_npm_organization = "@ownclouders"

def determineReleasePackage(ctx):
if ctx.build.event != "tag":
return None

matches = [p for p in web_publish_npm_packages if ctx.build.ref.startswith("refs/tags/" + p)]
if len(matches) > 0:
return matches[0]

return None

def determineReleaseVersion(ctx):
package = determineReleasePackage(ctx)
if package == None:
return ctx.build.ref.replace("refs/tags/v", "")

return ctx.build.ref.replace("refs/tags/" + package + "-v", "")

def buildRelease(ctx):
return [
{
"name": "make",
"image": OC_CI_NODEJS,
"commands": [
"cd %s" % dir["web"],
"make -f Makefile.release",
],
},
{
"name": "changelog",
"image": TOOLHIPPIE_CALENS,
"commands": [
# "calens --version %s -o dist/CHANGELOG.md -t changelog/CHANGELOG-Release.tmpl" % ctx.build.ref.replace("refs/tags/v", "").split("-")[0],
],
"when": {
"ref": [
"refs/tags/**",
],
},
},
# DO NOT RUN FOR PACKAGES
# {
# "name": "publish",
# "image": PLUGINS_GITHUB_RELEASE,
# "settings": {
# "api_key": {
# "from_secret": "github_token",
# },
# "files": [
# "release/*",
# ],
# "checksum": [
# "md5",
# "sha256",
# ],
# "title": ctx.build.ref.replace("refs/tags/v", ""),
# "note": "dist/CHANGELOG.md",
# "overwrite": True,
# },
# "when": {
# "ref": [
# "refs/tags/**",
# ],
# },
# },
]
steps = []
package = determineReleasePackage(ctx)
version = determineReleaseVersion(ctx)

if package == None:
steps += [
{
"name": "make",
"image": OC_CI_NODEJS,
"commands": [
"cd %s" % dir["web"],
"make -f Makefile.release",
],
},
{
"name": "changelog",
"image": TOOLHIPPIE_CALENS,
"commands": [
"calens --version %s -o dist/CHANGELOG.md -t changelog/CHANGELOG-Release.tmpl" % version.split("-")[0],
],
"when": {
"ref": [
"refs/tags/**",
],
},
},
# DO NOT RUN FOR PACKAGES
# {
# "name": "publish",
# "image": PLUGINS_GITHUB_RELEASE,
# "settings": {
# "api_key": {
# "from_secret": "github_token",
# },
# "files": [
# "release/*",
# ],
# "checksum": [
# "md5",
# "sha256",
# ],
# "title": ctx.build.ref.replace("refs/tags/v", ""),
# "note": "dist/CHANGELOG.md",
# "overwrite": True,
# },
# "when": {
# "ref": [
# "refs/tags/**",
# ],
# },
# },
]
else:
steps += [
{
"name": "publish",
"image": OC_CI_NODEJS,
"environment": {
"NODE_AUTH_TOKEN": {
"from_secret": "npm_token",
},
},
"commands": [
"echo " + determineReleasePackage(ctx) + " " + determineReleaseVersion(ctx),
"git checkout .", # setting the pnpm store dir modifies the .npmrc
"git clean -fd",
"git diff",
"git status",
"pnpm config set '//registry.npmjs.org/:_authToken' \"$${NODE_AUTH_TOKEN}\"",
"pnpm publish --no-git-checks --filter %s --access public --tag experimental" % ("%s/%s" % (web_publish_npm_organization, package)),
],
"when": {
"ref": [
"refs/tags/**",
],
},
},
]

return steps

def documentation(ctx):
return [
Expand Down
10 changes: 9 additions & 1 deletion packages/tsconfig/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"name": "@ownclouders/tsconfig",
"private": false,
"version": "0.0.1"
"version": "0.0.2",

"homepage": "https://github.com/owncloud/web/tree/master/packages/tsconfig",
"repository": {
"type": "git",
"url": "https://github.com/owncloud/web",
"directory": "packages/tsconfig"
}

}

0 comments on commit 6685ea3

Please sign in to comment.