chore: release cli 0.5.1 (#45) #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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: Create release artifacts folder | |
run: mkdir -p release-artifacts | |
- 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)}' | |
ARCHIVES=$(find . -regex "^./3rd-party-.*.zip$") | |
if [ -n "$ARCHIVES" ] | |
then | |
mv $(echo "${ARCHIVES}") ../release-artifacts/ | |
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 release-artifacts/cli-${GITHUB_REF#refs/*/cli-v}.jar | |
- name: Update Release with license obligations resources | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
artifacts: release-artifacts/* | |
artifactErrorsFailBuild: true | |
makeLatest: true | |
omitBodyDuringUpdate: true | |
omitNameDuringUpdate: true | |
- name: Publish version to GitHub Packages | |
run: mvn deploy -Dskip.tests --batch-mode --no-transfer-progress |