Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
nck-mlcnv committed May 22, 2024
1 parent a25ec5e commit fc97825
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 101 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: lint
# Check if version number has been updated

name: Version Check
on: pull_request

jobs:
Expand Down
99 changes: 0 additions & 99 deletions .github/workflows/ci.yml

This file was deleted.

156 changes: 156 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: Deployment

on:
push:
branches:
- main

jobs:
find_version:
name: Find Release Version
runs-on: ubuntu-latest
outputs:
RELEASE_VERSION: ${{ steps.step_find.outputs.RELEASE_VERSION }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: 'maven'
- name: 'Find velease version'
run: echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
id: step_find

deploy_to_maven:
name: Deploy to Maven Repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: 'maven'
- name: Publish package
run: mvn --batch-mode deploy -Dmaven.test.skip=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: 'iguana-jar'
path: 'target/'


compile_native:
name: Compile Native Executable
runs-on: ubuntu-latest
needs: find_version
steps:
- uses: actions/checkout@v4
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
cache: 'maven'
- name: 'Generate configuration files'
run: './graalvm/generate-config.sh'
- name: 'Compile native-binary'
run: 'mvn -DskipTests package -Pnative'
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
name: 'iguana-native'
path: 'target/iguana-${{ needs.find_version.outputs.RELEASE_VERSION }}'
if-no-files-found: error

deploy_docs:
name: Deploy Documentation
runs-on: ubuntu-latest
needs: find_version
env:
- RELEASE_VERSION: ${{ needs.find_version.outputs.RELEASE_VERSION }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: 'maven'
with:
python-version: 3.x
cache: 'pip'
- run: pip install mkdocs-material
- run: pip install mkdocs-macros-plugin
- run: sed -i "s/\$VERSION/${{ env.RELEASE_VERSION }}/g" mkdocs.yml
- run: sed -i "s/\$RELEASE_VERSION/${{ env.RELEASE_VERSION }}/g" mkdocs.yml
- run: mkdocs build -d site/${{ env.RELEASE_VERSION }}
- run: mvn javadoc:javadoc
- run: sed -i "s/\$VERSION/${{ env.RELEASE_VERSION }}/g" .github/pages/latest.html
- run: sed -i "s/\$VERSION/${{ env.RELEASE_VERSION }}/g" .github/pages/javadoc-latest.html
- name: Deploy Site
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site/${{ env.RELEASE_VERSION }}
destination_dir: ./docs/${{ env.RELEASE_VERSION }}
- name: Deploy Javadoc
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./javadoc/${{ env.RELEASE_VERSION }}
destination_dir: ./javadoc/${{ env.RELEASE_VERSION }}
- name: Deploy latest.html
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .github/pages/
keep_files: true
destination_dir: ./docs/
- name: Deploy latest.html
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .github/pages/
keep_files: true
destination_dir: ./docs/

deploy_gh_release:
runs-on: ubuntu-latest
needs: [compile-jar, deploy_to_maven, find_version]
env:
- RELEASE_VERSION: ${{ needs.find_version.outputs.RELEASE_VERSION }}

steps:
- name: Download artifacts from previous jobs
uses: actions/download-artifact@v4
with:
path: artifacts/
merge-multiple: true
- name: Prepare files
run: |
mkdir iguana
cp artifacts/start-iguana.sh iguana/
cp artifacts/iguana-${{ env.RELEASE_VERSION }}.jar iguana/iguana-${{ env.RELEASE_VERSION }}.jar
cp artifacts/iguana-${{ env.RELEASE_VERSION }} iguana/iguana-${{ env.RELEASE_VERSION }}
cp example-suite.yml iguana/
zip -r iguana-${{ env.RELEASE_VERSION }}.zip iguana/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.RELEASE_VERSION }}
name: version ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false
body: ""
fail_on_unmatched_files: true
make_latest: true
token: ${{ secrets.GITHUB_TOKEN }}
files: |
iguana-${{ env.RELEASE_VERSION }}.zip
artifacts/iguana-${{ env.RELEASE_VERSION }}.jar
artifacts/iguana-${{ env.RELEASE_VERSION }}
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: testing
name: Tests

on:
push:
Expand Down

0 comments on commit fc97825

Please sign in to comment.