Skip to content

Commit e19c954

Browse files
committed
CI: Switch to build as defined in centralized GitHub Action
Use `igniterealtime/openfire-plugin-builder-action` for easier maintenance. From a cursory look, this GitHub Action has been modified to account for the change needed to fix #31
1 parent 767ba60 commit e19c954

1 file changed

Lines changed: 5 additions & 69 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -3,72 +3,8 @@ name: Java CI
33
on: [push, pull_request]
44

55
jobs:
6-
build:
7-
runs-on: ubuntu-latest
8-
strategy:
9-
matrix:
10-
java: [ "8", "11" ]
11-
12-
steps:
13-
# Checkout Repo
14-
- uses: actions/checkout@v3
15-
16-
# Create a variable with this plugin's name
17-
- id: get-id
18-
name: Compute needed variables
19-
run: |
20-
set -x
21-
id=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
22-
echo "id=$id" >> $GITHUB_OUTPUT
23-
echo "id is '$id'"
24-
tag=$(echo ${{ github.ref }} | cut -d '/' -f3)
25-
echo "tag=$tag" >> $GITHUB_OUTPUT
26-
echo "tag is '$tag'"
27-
version=$(echo ${{ github.ref }} | cut -d '/' -f3 | cut -c 2-)
28-
echo "version=$version" >> $GITHUB_OUTPUT
29-
echo "version is '$version'"
30-
rel_id=$(curl -sL --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{github.repository}}/releases | jq -r --arg TAG "$tag" '.[] | select(.tag_name==$TAG) | .id')
31-
echo "rel_id=$rel_id" >> $GITHUB_OUTPUT
32-
echo "rel_id is '$rel_id'"
33-
34-
- name: Setup JDK ${{ matrix.java }}
35-
uses: actions/setup-java@v3
36-
with:
37-
java-version: ${{ matrix.java }}
38-
distribution: temurin
39-
40-
- name: Cache Maven repository
41-
uses: actions/cache@v3
42-
with:
43-
path: ~/.m2/repository
44-
key: ${{ runner.os }}-java${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}
45-
restore-keys: |
46-
${{ runner.os }}-java${{ matrix.java }}-maven-
47-
${{ runner.os }}-
48-
49-
- name: Igniterealtime CI Tooling
50-
run: |
51-
git clone --depth 1 https://github.com/igniterealtime/ci-tooling.git target/ci-tooling
52-
cp target/ci-tooling/maven-settings-for-openfire-plugins.xml $HOME/.m2/settings.xml
53-
54-
- name: Build with Maven
55-
run: mvn -B package
56-
57-
- name: Conditionally Deploy to Igniterealtime Archiva
58-
id: deploy
59-
if: ${{ contains(github.repository, 'igniterealtime/') && ( ( github.event_name == 'push' && github.ref == 'refs/heads/main' ) || contains(github.ref, 'refs/tags/') ) && matrix.java == '8' }}
60-
run: mvn -B deploy -Dmaven.resolver.transport=wagon --settings target/ci-tooling/maven-settings-for-openfire-plugins.xml
61-
env:
62-
CI_DEPLOY_USERNAME: ${{ secrets.IGNITE_REALTIME_MAVEN_USERNAME }}
63-
CI_DEPLOY_PASSWORD: ${{ secrets.IGNITE_REALTIME_MAVEN_PASSWORD }}
64-
65-
- name: Conditionally Push Artifact to Github Release
66-
uses: actions/upload-release-asset@v1
67-
if: ${{ contains(github.repository, 'igniterealtime/') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.java == '8' }}
68-
env:
69-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70-
with:
71-
upload_url: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.get-id.outputs.rel_id }}/assets?name=${{ steps.get-id.outputs.id }}.jar
72-
asset_path: target/${{ steps.get-id.outputs.id }}-openfire-plugin-assembly.jar
73-
asset_name: ${{ steps.get-id.outputs.id }}.jar
74-
asset_content_type: application/java-archive
6+
build:
7+
uses: igniterealtime/openfire-plugin-builder-action/.github/workflows/openfire-plugin-build.yml@main
8+
secrets:
9+
IGNITE_REALTIME_MAVEN_USERNAME: ${{ secrets.IGNITE_REALTIME_MAVEN_USERNAME }}
10+
IGNITE_REALTIME_MAVEN_PASSWORD: ${{ secrets.IGNITE_REALTIME_MAVEN_PASSWORD }}

0 commit comments

Comments
 (0)