Skip to content

Commit 073d9d0

Browse files
committed
Update workflow file
1 parent d56f839 commit 073d9d0

File tree

1 file changed

+5
-68
lines changed

1 file changed

+5
-68
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,10 @@
1-
# Version 2021-10-27
1+
# Version 2023-03-05
22
name: Java CI
33
on: [push, pull_request]
44

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