Skip to content

Commit

Permalink
prepare release and deployment of webjar as github package
Browse files Browse the repository at this point in the history
  • Loading branch information
svene committed May 24, 2024
1 parent dcf45cb commit 0a859f7
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/maven-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">

<!-- based on: https://stackoverflow.com/questions/57711558/deploy-to-github-package-registry-from-github-action -->

<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>

<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>github</id>
<name>GitHub Baloise Apache Maven Packages</name>
<url>https://maven.pkg.github.com/baloise-incubator</url>
</repository>
</repositories>
</profile>
</profiles>

<servers>
<server>
<id>github</id>
<username>${env.GITHUB_USERNAME}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>
</settings>
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
- 'baloise-design-system-webjar-*'

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Deploy to Github Package Registry
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn --settings .github/maven-settings.xml deploy
- name: Release using Github CLI
run: gh release create ${GITHUB_REF##*/} ./target/*.jar -t "Release ${GITHUB_REF##*/}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.baloise.webjars</groupId>
<artifactId>baloise-design-system</artifactId>
<version>1.0-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>baloise-design-system-webjar</name>
Expand Down

0 comments on commit 0a859f7

Please sign in to comment.