Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Amiya-873 authored Sep 24, 2024
1 parent 3404552 commit b8f1e32
Showing 1 changed file with 27 additions and 12 deletions.
39 changes: 27 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: CI
name: Build DCM Project and Create Release

on:
push:
branches:
- actions # Trigger on pushes to the "actions" branch
- actions # Triggers on push to the 'actions' branch
tags:
- '*' # Triggers on any tag creation (for release)

jobs:
build:
Expand All @@ -13,23 +15,36 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Java
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8' # JDK version
distribution: 'adopt' # Set the Java distribution
distribution: 'temurin' # You can change this to another JDK distribution if needed
java-version: '8'

- name: Install Ant
run: sudo apt-get install -y ant
- name: Install Apache Ant 1.9.9
run: |
wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.9-bin.zip
unzip apache-ant-1.9.9-bin.zip
sudo mv apache-ant-1.9.9 /usr/local/ant
echo "export PATH=\$PATH:/usr/local/ant/bin" >> $GITHUB_ENV
- name: Verify Ant installation
run: ant -version

- name: Set build version
run: echo "VERSION=${GITHUB_REF#refs/tags/}.${GITHUB_SHA:0:7}" >> $GITHUB_ENV

- name: Build the project
run: ant -Dplugin.version=${{ github.sha }}
env:
VERSION: ${{ env.VERSION }}
run: ant -Dplugin.version=${{ env.VERSION }}

- name: Archive artifacts
run: |
mkdir -p dist
cp dist/datapower-v*.zip dist/
cp dist/dcm.jar dist/
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
dist/datapower-v*.zip
dist/dcm.jar
release:
runs-on: ubuntu-20.04
Expand Down

0 comments on commit b8f1e32

Please sign in to comment.