Skip to content

Commit

Permalink
Migrate workflows to connectorio templates.
Browse files Browse the repository at this point in the history
Signed-off-by: Łukasz Dywicki <[email protected]>
  • Loading branch information
splatch committed Mar 4, 2024
1 parent 8a3fba3 commit e6b3440
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 120 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/maven.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build pull request

on:
pull_request:
branches: [ "master", "1.0.x" , "1.1.x" , "1.2.x" , "1.3.x" ]

jobs:
build:
permissions:
checks: write
contents: read
uses: 'connectorio/gh-actions-shared/.github/workflows/maven.yml@master'
secrets:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
with:
openhab: false
server_id: sonatype-nexus-snapshots
master_branch: 1.3.x
deploy: true
skip_test_publish: true
22 changes: 22 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build pushed commit

on:
push:
branches: [ "master", "1.0.x" , "1.1.x" , "1.2.x" , "1.3.x" ]

jobs:
build:
#if: ${{ true }}
permissions:
checks: write
contents: read
uses: 'connectorio/gh-actions-shared/.github/workflows/maven.yml@master'
secrets:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
with:
openhab: false
server_id: sonatype-nexus-snapshots
master_branch: 1.3.x
deploy: true
skip_test_publish: true
94 changes: 30 additions & 64 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,39 @@
name: Maven release
name: Release artifacts

on:
workflow_dispatch:
inputs:
releaseVersion:
description: "Release version."
release_version:
description: 'The version to be released from actual HEAD revision'
required: false
default: 'X.Y.Z'
development_version:
description: 'Version to be set as next, after release is made (appends commit to HEAD revision)'
required: false
default: 'X.Y.Z-SNAPSHOT'
perform_version:
description: 'Tag which should be used to perform release and publish its artifacts'
required: false
dry_run:
description: 'Should execution abstain from mutating repository/remote state?'
required: true
default: "X.Y.Z"
developmentVersion:
description: "Version to which working copy should be set after release."
required: true
default: "X.Y.Z-SNAPSHOT"
dryRun:
description: "Should release be done in dry-run mode."
required: true
default: "true"
default: 'true'

jobs:
release:
runs-on: ubuntu-latest
build:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Setup git
run: |
git config user.email "[email protected]"
git config user.name "ConnectorIO Bot"
git config url."https://${BUILD_USER}:${BUILD_TOKEN}@github.com/".insteadOf "[email protected]:"
export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1
env:
BUILD_USER: x-access-token
BUILD_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
server-id: sonatype-nexus-staging
server-username: CI_RELEASE_USERNAME
server-password: CI_RELEASE_PASSWORD
gpg-passphrase: GPG_PASSPHRASE
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Maven Prepare Release
run: >-
mvn -B
release:prepare -DpreparationProfiles=release
-DreleaseVersion=${{ inputs.releaseVersion }}
-DdevelopmentVersion=${{ inputs.developmentVersion }}
-DdryRun=${{ inputs.dryRun }}
- name: Maven Perform Release
if: success()
run: >-
mvn -B
release:perform -DreleaseProfiles=release
env:
CI_RELEASE_USERNAME: ${{ secrets.CI_RELEASE_USERNAME }}
CI_RELEASE_PASSWORD: ${{ secrets.CI_RELEASE_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Rollback on failure
if: failure()
run: |
mvn -B release:rollback
echo "You may need to manually delete the git tag, if it was created."
uses: 'connectorio/gh-actions-shared/.github/workflows/release.yml@master'
secrets:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
CI_RELEASE_USERNAME: ${{ secrets.CI_RELEASE_USERNAME }}
CI_RELEASE_PASSWORD: ${{ secrets.CI_RELEASE_PASSWORD }}
with:
openhab: false
server_id: 'sonatype-nexus-staging'
master_branch: 1.3.x
release_version: ${{ inputs.release_version }}
development_version: ${{ inputs.development_version }}
perform_version: ${{ inputs.perform_version }}
dry_run: ${{ inputs.dry_run }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Code-House Bacnet4J wrapper

[![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)
[![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)
[![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)

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

0 comments on commit e6b3440

Please sign in to comment.