Skip to content

Commit 9f70359

Browse files
committed
Migrate workflows to connectorio templates.
Signed-off-by: Łukasz Dywicki <[email protected]>
1 parent 9a10da4 commit 9f70359

File tree

5 files changed

+74
-120
lines changed

5 files changed

+74
-120
lines changed

.github/workflows/maven.yml

-55
This file was deleted.

.github/workflows/pr.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build pull request
2+
3+
on:
4+
pull_request:
5+
branches: [ "master", "1.0.x" , "1.1.x" , "1.2.x" , "1.3.x" ]
6+
7+
jobs:
8+
build:
9+
permissions:
10+
checks: write
11+
contents: read
12+
uses: 'connectorio/gh-actions-shared/.github/workflows/maven.yml@master'
13+
secrets:
14+
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
15+
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
16+
with:
17+
openhab: false
18+
server_id: sonatype-nexus-snapshots
19+
master_branch: 1.3.x
20+
deploy: true
21+
skip_test_publish: true

.github/workflows/push.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Build pushed commit
2+
3+
on:
4+
push:
5+
branches: [ "master", "1.0.x" , "1.1.x" , "1.2.x" , "1.3.x" ]
6+
7+
jobs:
8+
build:
9+
#if: ${{ true }}
10+
permissions:
11+
checks: write
12+
contents: read
13+
uses: 'connectorio/gh-actions-shared/.github/workflows/maven.yml@master'
14+
secrets:
15+
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
16+
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
17+
with:
18+
openhab: false
19+
server_id: sonatype-nexus-snapshots
20+
master_branch: 1.3.x
21+
deploy: true
22+
skip_test_publish: true

.github/workflows/release.yml

+30-64
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,39 @@
1-
name: Maven release
1+
name: Release artifacts
22

33
on:
44
workflow_dispatch:
55
inputs:
6-
releaseVersion:
7-
description: "Release version."
6+
release_version:
7+
description: 'The version to be released from actual HEAD revision'
8+
required: false
9+
default: 'X.Y.Z'
10+
development_version:
11+
description: 'Version to be set as next, after release is made (appends commit to HEAD revision)'
12+
required: false
13+
default: 'X.Y.Z-SNAPSHOT'
14+
perform_version:
15+
description: 'Tag which should be used to perform release and publish its artifacts'
16+
required: false
17+
dry_run:
18+
description: 'Should execution abstain from mutating repository/remote state?'
819
required: true
9-
default: "X.Y.Z"
10-
developmentVersion:
11-
description: "Version to which working copy should be set after release."
12-
required: true
13-
default: "X.Y.Z-SNAPSHOT"
14-
dryRun:
15-
description: "Should release be done in dry-run mode."
16-
required: true
17-
default: "true"
20+
default: 'true'
1821

1922
jobs:
20-
release:
21-
runs-on: ubuntu-latest
23+
build:
2224
permissions:
2325
contents: write
24-
steps:
25-
- uses: actions/checkout@v3
26-
- name: Setup git
27-
run: |
28-
git config user.email "[email protected]"
29-
git config user.name "ConnectorIO Bot"
30-
git config url."https://${BUILD_USER}:${BUILD_TOKEN}@github.com/".insteadOf "[email protected]:"
31-
export GIT_TRACE_PACKET=1
32-
export GIT_TRACE=1
33-
export GIT_CURL_VERBOSE=1
34-
env:
35-
BUILD_USER: x-access-token
36-
BUILD_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
- uses: actions/setup-java@v3
38-
with:
39-
distribution: 'temurin'
40-
java-version: '11'
41-
server-id: sonatype-nexus-staging
42-
server-username: CI_RELEASE_USERNAME
43-
server-password: CI_RELEASE_PASSWORD
44-
gpg-passphrase: GPG_PASSPHRASE
45-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
46-
- name: Cache local Maven repository
47-
uses: actions/cache@v3
48-
with:
49-
path: ~/.m2/repository
50-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
51-
restore-keys: |
52-
${{ runner.os }}-maven-
53-
- name: Maven Prepare Release
54-
run: >-
55-
mvn -B
56-
release:prepare -DpreparationProfiles=release
57-
-DreleaseVersion=${{ inputs.releaseVersion }}
58-
-DdevelopmentVersion=${{ inputs.developmentVersion }}
59-
-DdryRun=${{ inputs.dryRun }}
60-
- name: Maven Perform Release
61-
if: success()
62-
run: >-
63-
mvn -B
64-
release:perform -DreleaseProfiles=release
65-
env:
66-
CI_RELEASE_USERNAME: ${{ secrets.CI_RELEASE_USERNAME }}
67-
CI_RELEASE_PASSWORD: ${{ secrets.CI_RELEASE_PASSWORD }}
68-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
69-
- name: Rollback on failure
70-
if: failure()
71-
run: |
72-
mvn -B release:rollback
73-
echo "You may need to manually delete the git tag, if it was created."
26+
uses: 'connectorio/gh-actions-shared/.github/workflows/release.yml@master'
27+
secrets:
28+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
29+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
30+
CI_RELEASE_USERNAME: ${{ secrets.CI_RELEASE_USERNAME }}
31+
CI_RELEASE_PASSWORD: ${{ secrets.CI_RELEASE_PASSWORD }}
32+
with:
33+
openhab: false
34+
server_id: 'sonatype-nexus-staging'
35+
master_branch: 1.3.x
36+
release_version: ${{ inputs.release_version }}
37+
development_version: ${{ inputs.development_version }}
38+
perform_version: ${{ inputs.perform_version }}
39+
dry_run: ${{ inputs.dry_run }}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Code-House Bacnet4J wrapper
22

3-
[![Maven build](https://github.com/Code-House/bacnet4j-wrapper/actions/workflows/maven.yml/badge.svg)](https://github.com/Code-House/bacnet4j-wrapper/actions/workflows/maven.yml)
3+
[![Maven build](https://github.com/Code-House/bacnet4j-wrapper/actions/workflows/maven.yml/badge.svg)](https://github.com/Code-House/bacnet4j-wrapper/actions/workflows/push.yml)
44
[![Maven release](https://github.com/Code-House/bacnet4j-wrapper/actions/workflows/release.yml/badge.svg?event=release)](https://github.com/Code-House/bacnet4j-wrapper/actions/workflows/release.yml)
55

66
[![GitHub license](https://img.shields.io/github/license/Code-House/bacnet4j-wrapper.svg)](https://github.com/Code-House/bacnet4j-wrapper/blob/master/LICENSE)

0 commit comments

Comments
 (0)