Skip to content

chore: release cli 0.4.1 (#39) #3

chore: release cli 0.4.1 (#39)

chore: release cli 0.4.1 (#39) #3

Workflow file for this run

#
# 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: |
mkdir -p license-obligations
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)}'
ARCHIVES=$(find . -regex "^./3rd-party-.*.zip$")
if [ -n "$ARCHIVES" ]
then
mv $(echo "${ARCHIVES}") ../license-obligations/
fi
- 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: Build artifact
run: |
mvn package -Dskip.tests --batch-mode --no-transfer-progress &&
cp target/cli-${GITHUB_REF#refs/*/cli-v}-jar-with-dependencies.jar cli-${GITHUB_REF#refs/*/cli-v}.jar
- name: Update Release with license obligations resources
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: license-obligations/*,cli-${GITHUB_REF#refs/*/cli-v}.jar
artifactErrorsFailBuild: true
makeLatest: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
- name: Publish version to GitHub Packages
run: mvn deploy -Dskip.tests --batch-mode --no-transfer-progress