From a4918dba33e5d4dcaf7ffaf4c8b69d4faa5b46ad Mon Sep 17 00:00:00 2001 From: Maged Elaasar Date: Mon, 11 Nov 2024 11:21:26 -0800 Subject: [PATCH] Switch CI/CD to Github Actions --- .deploy/deploy.sh | 57 --------------------------------------- .deploy/deploy_key.enc | Bin 3392 -> 0 bytes .github/workflows/cd.yml | 57 +++++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 29 ++++++++++++++++++++ .travis.yml | 30 --------------------- README.md | 7 +++-- build.gradle | 4 +-- 7 files changed, 91 insertions(+), 93 deletions(-) delete mode 100755 .deploy/deploy.sh delete mode 100644 .deploy/deploy_key.enc create mode 100644 .github/workflows/cd.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.deploy/deploy.sh b/.deploy/deploy.sh deleted file mode 100755 index 3d92738..0000000 --- a/.deploy/deploy.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -set -ev -STATUS=`git log -1 --pretty=oneline` - -# Partially based on https://gist.github.com/domenic/ec8b0fc8ab45f39403dd - -SOURCE_BRANCH="master" -TARGET_BRANCH="gh-pages" - -# Save some useful information -REPO=`git config remote.origin.url` -SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} -SHA=`git rev-parse --verify HEAD` -SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) - -echo $SSH_REPO - -# Clone the existing gh-pages for this repo into publish/ -# Create a new empty branch if gh-pages doesn't exist yet (should only happen on first deploy) -cd $SCRIPT_PATH -git clone $REPO publish -cd publish -git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH -cd .. - -# Clean out existing contents -rm -rf publish/**/* || exit 0 - -cd ${SCRIPT_PATH}/../build/doc -find . -name '*' -exec cp --parents {} ${SCRIPT_PATH}/publish/ \; -cd ${SCRIPT_PATH} - -# Now let's go have some fun with the cloned repo -cd publish -git init -git config user.name "Travis CI" -git config user.email "$COMMIT_AUTHOR_EMAIL" - -# Commit the "changes", i.e. the new version. -# The delta will show diffs between new and old versions. -git add -A . -git commit -m "Built by Travis-CI: $STATUS" -git status - - -# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc -ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key" -ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv" -ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR} -ENCRYPTED_IV=${!ENCRYPTED_IV_VAR} -openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in ${SCRIPT_PATH}/deploy_key.enc -out ${SCRIPT_PATH}/deploy_key -d -chmod 600 ${SCRIPT_PATH}/deploy_key -eval `ssh-agent -s` -ssh-add ${SCRIPT_PATH}/deploy_key - -# Now that we're all set up, we can push. -git push $SSH_REPO $TARGET_BRANCH \ No newline at end of file diff --git a/.deploy/deploy_key.enc b/.deploy/deploy_key.enc deleted file mode 100644 index ada2d21a85b54c4a66220ba748bc77db051a44dd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3392 zcmV-G4Zrd&4IuS6AU^}5U19H@_-YbWlXX&&p@M`s`%Ble%^*YUKAm_FK$ynhK;i4b z%G>>MK@XWjigBy-#6%KPi*!@w02Dg*(FNP?>e9Ps6)Ee^eH!s|>g?Qg`1(jU4$r1H zH)D8+`4p3z2S=y27v#6%^Jo*Cv=o#7^%KQ`#~F&YX( zs>gv)Hs)g(#edf_sm=YQZ={6GS!&9$zg!7|liB5An~DFgHS_s^0&99ATiZw5?qSpM zc&|XOT{UQn+3?%ZowCpA5Xk$BP~M=ut7V-%L**1M3U zbwU)-RE@Eu>@I(v#s(q#@fzX?^Io}h*ui8%M_K!2xXt(ITK+TP_)yhyKpM4!Ou=kb zfO*PPPBl_M!v0IULfcrv4k{G+okGvjo$>|nj6eMJE|zIDjOQn58Miw2Qcf5?*5^*cW!c-4n*Jerf*aFil3 z(bA&3D5B=3`JsU{$|55rj>LbzM6k~_M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wCSNC&Y1-yZk@<+K)9`^9fhG9r*f>~glfDr-<84$ zr*IZV4_#4GrcgxKgY*A&)WPoPH02*RWo)5+L!Xea4leW+(Rw{D9|`#X)IKBWtYI;w zgM(FZD@K!*AY&9%xc_ter=I|5H>X=I(@ddj1%~+i{q>4+nyfg`Z2iBv+U3ZWqon35 zU4ACoB>DXAJ)i-oF`On$kLMcw>oLo70mh;6ls#g8T(Ix#ygxQ;)5p~&O%KduR^?!t za{0f07vfEb@do2nn+QZxmOn^j5>-Ti&CaOsm8~;<(_NS0CFSfZLrf(2kxrEiy`4jI zf$t^f$Ia?&q2+_qoCE#G126j zARaq(ljht&+byraLz%?m5|tfPy5z}=KM8Imo8Z5PsAj45JVFRZkHMs6ynl_BUL zl?$Hp?dd&7EVQ(OK?rVHgQk<bR1JYqGGd^ z+qosOH^Es%;3!&k*yj!3z_zpz|K}@Z?gR>MuARc+*640<+E-%AhXexG^r;poN`oc4 WD3>Q0s0bhHGQS$`(^FF^jFWHQMxL1f diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..6aff19e --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,57 @@ +name: CD + +on: + release: + types: [published] + +jobs: + publish: + + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'gradle' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + + - name: Publish package + run: ./gradlew publish + env: + ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRHPASSWORD }} + ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRHUSERNAME }} + ORG_GRADLE_PROJECT_pgpSigningKey: ${{ secrets.PGPSIGNINGKEY }} + ORG_GRADLE_PROJECT_pgpSigningPassword: ${{ secrets.PGPSIGNINGPASSWORD }} + + - name: Generate Docs + run: ./gradlew generateDocs + + - name: Publish Spec + uses: actions/upload-pages-artifact@v1 + with: + path: build/docs + + deploy: + + needs: publish + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Deploy Spec + id: deployment + uses: actions/deploy-pages@v1 + \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..971f6ef --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'gradle' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + + - name: Build with Gradle Wrapper + run: ./gradlew build \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7a7bae3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: java - -jdk: - - openjdk17 - -cache: - directories: - - $HOME/.gradle - -script: - - ./gradlew build generateDocs --refresh-dependencies - -env: - global: - - ENCRYPTION_LABEL: "e35fe261275e" - - COMMIT_AUTHOR_EMAIL: "melaasar@gmail.com" - -deploy: - - provider: script - script: .deploy/deploy.sh - skip_cleanup: true - on: - tags: true - branch: master - - provider: script - script: ./gradlew publish - skip_cleanup: true - on: - tags: true - branch: master diff --git a/README.md b/README.md index d656b99..21d10d5 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ # IMCE Vocabularies -[![Build Status](https://app.travis-ci.com/opencaesar/imce-vocabularies.svg?branch=master)](https://app.travis-ci.com/github/opencaesar/imce-vocabularies) -[![Release](https://img.shields.io/github/v/tag/opencaesar/imce-vocabularies?label=release)](https://github.com/opencaesar/imce-vocabularies/releases/latest) -[![Documentation](https://img.shields.io/badge/Documentation-HTML-orange)](https://opencaesar.github.io/imce-vocabularies/) -[![Gitpod](https://img.shields.io/badge/gitpod-open-blue?logo=gitpod)](https://gitpod.io/#https://github.com/opencaesar/imce-vocabularies) +[![Build Status](https://github.com/opencaesar/imce-vocabularies/actions/workflows/ci.yml/badge.svg)](https://github.com/opencaesar/imce-vocabularies/actions/workflows/ci.yml) +[![Release](https://img.shields.io/github/v/release/opencaesar/imce-vocabularies?label=Release)](https://github.com/opencaesar/imce-vocabularies/releases/latest) +[![Documentation](https://img.shields.io/badge/Documentation-HTML-orange)](https://www.opencaesar.io/imce-vocabularies/) This is a set of IMCE vocabularies expressed in [OML](https://github.com/opencaesar/oml) diff --git a/build.gradle b/build.gradle index dd8ff0e..e701171 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ ext.title = "IMCE Vocabularies" description='The set of IMCE vocabularies' group = 'io.opencaesar.ontologies' -version = '5.0.0' +version = '5.1.0' apply from: "${rootDir}/gradle/maven-deployment.gradle" @@ -101,7 +101,7 @@ task generateDocs (type: io.opencaesar.owl.doc.OwlDocTask, dependsOn: owlReason) // OWL Ontology Iris inputOntologyIris = [ "$rootIri/classes", "$rootIri/properties", "$rootIri/individuals" ] // Output folder - outputFolderPath = file('build/doc') + outputFolderPath = file('build/docs') // Output case sensitivie path outputCaseSensitive = org.gradle.internal.os.OperatingSystem.current().isLinux() }