Skip to content

Commit

Permalink
fix: introduce release-please process (#34)
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Becker <[email protected]>
  • Loading branch information
sbckr authored Jul 28, 2023
1 parent db83ec5 commit d4fe837
Show file tree
Hide file tree
Showing 10 changed files with 156 additions and 182 deletions.
66 changes: 0 additions & 66 deletions .github/scripts/generate-changelog.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2021 - for information on the respective copyright owner
# Copyright (c) 2021-2023 - for information on the respective copyright owner
# see the NOTICE file and/or the repository https://github.com/carbynestack/cli.
#
# SPDX-License-Identifier: Apache-2.0
Expand All @@ -14,18 +14,19 @@ on:
branches:
- 'master'
jobs:
test:
runs-on: ubuntu-20.04
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: Setting up Github Package Repository as Maven Repository
uses: s4u/maven-settings-action@v2
uses: s4u/maven-settings-action@v2.8.0
with:
githubServer: false
servers: |
Expand All @@ -36,6 +37,28 @@ jobs:
}]
- name: Build with Maven
run: mvn install -Dskip.tests --batch-mode --update-snapshots --no-transfer-progress
test:
runs-on: ubuntu-22.04
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: Setting up Github Package Repository as Maven Repository
uses: s4u/[email protected]
with:
githubServer: false
servers: |
[{
"id": "github",
"username": "${{ github.actor }}",
"password": "${{ secrets.GITHUB_TOKEN }}"
}]
- name: Run Tests
run: mvn verify --activate-profiles coverage --batch-mode --no-transfer-progress
- name: Collect Jacoco reports
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/java.publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#
# Copyright (c) 2021-2023 - for information on the respective copyright owner
# see the NOTICE file and/or the repository https://github.com/carbynestack/cli.
#
# SPDX-License-Identifier: Apache-2.0
#
name: Publish and Release
on:
push:
tags:
- "cli-v[0-9]+.[0-9]+.[0-9]+"
jobs:
publish:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Retrieve license obligation resources
id: license-obligations
run: |
cd 3RD-PARTY-LICENSES
FILES=$(find . -maxdepth 1 -type d -not -path .)
if [ -n "$FILES" ]
then
echo "${FILES}" | zip -r@ 3rd-party-copyrights
fi
find . -iname origin.src | \
awk '{ \
split($0,b,"/"); \
system("xargs < " $0 " curl --create-dirs -Lo ./sources/" b[2] ".zip " $2)}' && \
find -regex './sources$' | awk '{system("zip -jr ./3rd-party-sources.zip " $0)}'
mkdir -p ../license-obligations
ARCHIVES=$(find . -regex "^./3rd-party-.*.zip$")
OBLIGATIONS_FOUND="false"
if [ -n "$ARCHIVES" ]
then
mv $(echo "${ARCHIVES}") ../license-obligations/
OBLIGATIONS_FOUND="true"
fi
echo "OBLIGATIONS_FOUND=${OBLIGATIONS_FOUND}" >> $GITHUB_OUTPUT
- name: Update Release with license obligations resources
uses: ncipollo/release-action@v1
if: steps.license-obligations.outputs.OBLIGATIONS_FOUND == 'true'
with:
allowUpdates: true
artifacts: license-obligations/*
artifactErrorsFailBuild: true
makeLatest: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
- name: Setup java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: Setting up Github Package Repository as Maven Repository
uses: s4u/[email protected]
with:
githubServer: false
servers: |
[{
"id": "github",
"username": "${{ secrets.GHPR_USERNAME }}",
"password": "${{ secrets.GHPR_TOKEN }}"
}]
- name: Publish version to GitHub Packages
run: mvn deploy -Dskip.tests --batch-mode --no-transfer-progress
99 changes: 0 additions & 99 deletions .github/workflows/publish-and-release.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Copyright (c) 2023 - for information on the respective copyright owner
# see the NOTICE file and/or the repository https://github.com/carbynestack/cli.
#
# SPDX-License-Identifier: Apache-2.0
#
name: Release
on:
push:
branches:
- master
jobs:
release-please:
runs-on: ubuntu-22.04
steps:
- name: Release Please
uses: google-github-actions/release-please-action@v3
with:
command: manifest
signoff: "cs-minion <[email protected]>"
token: ${{ secrets.CS_MINION_PAT }}
12 changes: 10 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#
# Copyright (c) 2021 - for information on the respective copyright owner
# Copyright (c) 2021-2023 - for information on the respective copyright owner
# see the NOTICE file and/or the repository https://github.com/carbynestack/cli.
#
# SPDX-License-Identifier: Apache-2.0
#
repos:
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.5.0
hooks:
- id: commitlint
stages:
- commit-msg
additional_dependencies:
- '@commitlint/config-conventional'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
Expand All @@ -31,4 +39,4 @@ repos:
rev: v0.33.0
hooks:
- id: markdownlint
exclude: ^README.md$
exclude: ^README.md$|.*/3RD-PARTY-LICENSES/.*
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.3.0"
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![codecov](https://codecov.io/gh/carbynestack/cli/branch/master/graph/badge.svg?token=ja4W6WLOHO)](https://codecov.io/gh/carbynestack/cli)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/67fd8c2ab94f4756a0d5cfc326ac0567)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=carbynestack/cli&utm_campaign=Badge_Grade)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
[![Known Vulnerabilities](https://snyk.io/test/github/carbynestack/cli/badge.svg)](https://snyk.io/test/github/carbynestack/cli)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
Expand Down
Loading

0 comments on commit d4fe837

Please sign in to comment.