Skip to content

Commit

Permalink
Release drafter workflow and github release features (#215)
Browse files Browse the repository at this point in the history
* Release drafter workflow
* Release workflow
* Remove gradle release plugin
* Use github releases
* remove zip file
* Another ESLint fix.
* Revert unwanted changes
* Revert unwanted changes

Co-authored-by: Stanislaw <stanislaw.rosada@gmail.com>
Co-authored-by: Szymon Owczarzak <szymon.owczarzak@gmail.com>
  • Loading branch information
3 people committed Jan 14, 2020
1 parent 9220072 commit 2cd302b
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 45 deletions.
17 changes: 17 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
template: |
# What's Changed
$CHANGES
categories:
- title: 'New'
label: 'enhancement'
- title: 'Bug Fixes'
label: 'bug'
- title: 'Maintenance'
label: 'maintenance'
- title: 'Documentation'
label: 'documentation'
- title: 'Dependency Updates'
label: 'dependencies'
31 changes: 31 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release Drafter

on:
push:
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- name: Release draft
id: release_draft
uses: release-drafter/release-drafter@v5.6.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Checkout code
# uses: actions/checkout@master
# - name: Build asset # This would actually build your project, using zip for an example artifact
# run: |
# zip -r cogboard cogboard-compose.yml mnt
# - name: Upload Release Asset
# id: upload-release-asset
# uses: actions/upload-release-asset@v1.0.1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.release_draft.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ./cogboard.zip
# asset_name: cogboard.zip
# asset_content_type: application/zip
42 changes: 42 additions & 0 deletions .github/workflows/release_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
release:
types: [published]

name: Release version

jobs:
build:
name: Release version
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Release
run: |
echo lets do the release.
- name: Bump version
id: bump_version
run: |
export VERSION=$(sed -n '1s/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/p' gradle.properties)
export NEXT_VERSION=$(echo $VERSION | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')
echo "::set-output name=next_ver::$NEXT_VERSION"
sed -i "1s%version=.*%version=$NEXT_VERSION%g" gradle.properties
- name: Commit files
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "[skip travis] Bump version" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create draft release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.bump_version.outputs.next_ver }}
release_name: ${{ steps.bump_version.outputs.next_ver }}
draft: true
prerelease: false
27 changes: 2 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,12 @@ services:
- docker
jdk:
- oraclejdk11
before_script:
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_EVENT_TYPE" == "push" ]]; then export
RELEASE=1 && git checkout master && git remote set-url origin https://"$GITHUB_USERNAME":"$GITHUB_PASSWORD"@github.com/Cognifide/cogboard.git;
fi
- if [[ "$TRAVIS_BRANCH" != "master" && "$TRAVIS_EVENT_TYPE" == "push" ]]; then export DEV_BUILD=1; fi
- export VERSION=$(sed -n '1s/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/p' gradle.properties)
- cd functional/cypress-tests && npm install && npx eslint "cypress/**/*.js" && cd ../..
script:
- if [[ "$RELEASE" == "1" ]]; then ./gradlew release -Prelease.useAutomaticVersion=true -DcypressEnv=travis
--info; fi
- if [[ "$RELEASE" != "1" ]]; then ./gradlew functionalTests -DcypressEnv=travis; fi
deploy:
- provider: script
script: bash scripts/release.sh
on:
condition: "$RELEASE = 1"
- provider: script
script: bash scripts/dev_build.sh
on:
all_branches: true
condition: "$DEV_BUILD = 1"
- ./gradlew functionalTests -DcypressEnv=travis
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
env:
global:
- secure: Am67p/tzwtBKjUYnVjNrLI9prTLr1Bq6TeuaQYM6YxBpijvBa/XXveJT6m6xfaCCxk8XmKUvmhBoVfug896GBE+TCIVqUbARb06x9gmqH6qQa5b9yPHmkeesxgAObDrasbTCRDQj2ADVQaaya3WH2w4QkKTknNF/XDMiSD2b0cJ6iTLHAy7OY+iIOCLFXRtWqUNyKSBmF9ZFBexs6SENJ0TJggawP5ZyZpVqTsDUB3mbfB9ZegVTWaqr2Plf8/3pk5c/f3pamP4YACgc/Pak71TAwwBaDGlHggnQexgIeluHmABHkt7IBtXOLXQCme3WWL4we7B49Y7QlxhRyLGfMIwZF99mEozOTynW2i8aYQSrRpik7GB882AJxmumAh+FVSzxAZNSFSTrFrFz3+zumxiyALVOgwzg1cI4SAxuOxc2/dYAANzrLJt4WyaVNjEzum19C52Is/fKzPqNQNu5lFlkmsAblXxLYePQi4jxzdj+AyLk7NvGortoCUWZLxmedpRrGaVZ0xqCqLtcDjQqes5umGAlN5Mt4b2zdKXkUmf/uVRgo5PRQwC+WxqWt00ePgfi5cQIGX4Cs5Gt6JcRmvzZT7dXvujJS4ykjH4V7GoSW7z9s3gKRp9QqRonEpV3uh/Z2J6uNxjUhQO36ZrVoecaQFvZaQh4OedQv/r3vi8=
- secure: BN6g7txDLcN1dVRHssroiQDCxvAda06P0Xasnz8kX3FdlpMN4gwJOeqjo7AOB2K8F053qOUFt3HiJ+2XLzfIjAmG/71wmdFXWa++KPOfzhZadk3bzdeI7FTdeMB09iRjK5w15ZvMbptLXEL78fxxBmlEKQ8VvPRMasEhmAaQontYhQMsRl/6yzDR6TisWHEXuihoiISu4v7onTZbbOkiS/Kip1RYUtXW7rJhXtF5nlck9NTyARt/Xz5Ttd6pVvAezhirN9hrAWnJNBp8XlZBH+MBUJd7FOqHov1egc59+0RttzggGoSrBB57Q8S7WSBKZ5D+mreKGgzvSxgu15qktduWxVqFJRMkZq9LIFk02cMuvBPz+EE43yA+xCIYZdFohOQ7fgSVgI8JD8GDDv58iiIXyDcFDYccvKCIHMBArsmDs1EUBCqvD69IiO6bZ3m1RfFrWxIZbx2DlGVIm3mJbNimniOl3ZSFWFGz9XGN1klt37mHi1Ludgpn8En3iNSriplihZagGrHMepRPPzJ+Rp9wGXYH740SRqAqrss7IY5qHT8g1TprBGBsSM2hTHBMKidEVhTUwK2OcST8Qd46YsyYt0eHrzAZJJM9EAs5rin6SkeYQfdX8cU7fL9rHN1w+hIMjw5r+UJowYoiq5KMyjXW8PefuKQhtBEY9Yk54J8=
- "$HOME/.gradle/wrapper/"
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Pull requests need to follow provided [Pull Request Template](https://github.com

## Documentation

CogBoard's documentation can be found in [CogBoard Wiki](https://github.com/Cognifide/cogboard/wiki).
CogBoard's documentation can be found in [CogBoard Wiki](https://github.com/Cognifide/cogboard/wiki).

## Coding conventions

Expand Down
2 changes: 0 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ plugins {
id("com.bmuschko.docker-remote-api")
id("java")
id("io.gitlab.arturbosch.detekt") version "1.1.0"
id("net.researchgate.release")
}

val dockerContainerName = project.property("docker.app.container.name") ?: "cogboard"
Expand Down Expand Up @@ -63,7 +62,6 @@ detekt {
apply(from = "gradle/distribution.gradle.kts")
apply(from = "gradle/javaAndUnitTests.gradle.kts")
apply(from = "gradle/docker.gradle.kts")
apply(from = "gradle/release.gradle")

//gradle.taskGraph.whenReady {
// this.allTasks.forEach { logger.error(it.path + " " + it.name) }
Expand Down
14 changes: 14 additions & 0 deletions cogboard-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3.7"

services:
backend:
image: "cogboard/cogboard-app:latest"
volumes:
- "./mnt:/data"

frontend:
image: "cogboard/cogboard-web:latest"
depends_on:
- "backend"
ports:
- "80:80"
Binary file removed cogboard.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.101.0-SNAPSHOT
version=0.101.0

# Knot.x Docker image version (https://hub.docker.com/r/knotx/knotx)
knotx.version=2.0.0
Expand Down
16 changes: 0 additions & 16 deletions gradle/release.gradle

This file was deleted.

0 comments on commit 2cd302b

Please sign in to comment.