From 68b709a18bde4493100997fae7facc62a0bf7916 Mon Sep 17 00:00:00 2001 From: Vincent Cantin Date: Sat, 4 Jan 2025 11:46:29 +0200 Subject: [PATCH] Github action - release --- .github/workflows/release.yml | 45 +++++++++++++++++++++++++++++++++++ deps.edn | 34 ++++++++++++++++---------- pom.xml | 39 ++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 pom.xml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d30fd7b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Release + +on: + release: + types: + - published # reacts to releases and pre-releases, but not their drafts + +jobs: + + build-and-release: + + name: Release + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Java 8 + uses: actions/setup-java@v1.4.3 + with: + java-version: 8 + + - uses: actions/setup-node@v4 + with: + node-version: lts/hydrogen + + - name: Setup Clojure + uses: DeLaGuardo/setup-clojure@master + with: + cli: latest + + - run: npm ci + + - name: Run the CLJ and CLJS tests + run: ./bin/kaocha + + - name: Build the jar and update pom.xml's version + run: clojure -X:depstar + + - name: Deploy the jar and pom files to Clojars + run: clojure -X:deploy + env: + CLOJARS_USERNAME: metosinci + CLOJARS_PASSWORD: "${{ secrets.CLOJARS_DEPLOY_TOKEN }}" diff --git a/deps.edn b/deps.edn index 0cdce0b..ba08786 100644 --- a/deps.edn +++ b/deps.edn @@ -15,17 +15,27 @@ :outdated {:extra-deps {com.github.liquidz/antq {:mvn/version "2.11.1260"}} :main-opts ["-m" "antq.core"]} - :depstar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.303"}} - :exec-fn hf.depstar/jar - :exec-args {:sync-pom true - :group-id "fi.metosin" - :artifact-id "signaali" - :version "0.1.0" - :jar "signaali.jar"}}}} + :jar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.303"}} + :exec-fn hf.depstar/jar + :exec-args {:sync-pom true + :group-id "fi.metosin" + :artifact-id "signaali" + :version "0.1.0" + :jar "signaali.jar"}} -;; Memo for deploying a new release: -;; - Change the version above, then build the jar: -;; clojure -X:depstar -;; - add a tag "v0.x.y" to the latest commit and push to repo + :deploy {:extra-deps {slipset/deps-deploy {:mvn/version "0.2.2"}} + :exec-fn deps-deploy.deps-deploy/deploy + :exec-args {:installer :remote + :sign-releases? true + :artifact "signaali.jar"}}}} + +;; Memo for making a new release: +;; 1. Change the version above, make it a git commit, +;; 2. add a git tag "v0.x.y" to the commit, +;; 3. push the commit and tag to Github. + +;; This part is now done via Github's actions, triggered by a release, triggered by pushing a git tag v**: +;; - build the jar and update the pom's version: +;; clojure -X:jar ;; - deploy: -;; mvn deploy:deploy-file -Dfile=signaali.jar -DpomFile=pom.xml -DrepositoryId=clojars -Durl=https://clojars.org/repo/ +;; clojure -X:deploy diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..fa739b3 --- /dev/null +++ b/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + jar + fi.metosin + signaali + 0.1.0 + signaali + Small, portable & flexible implementation of signals + 2023 + + + EPL-2.0 + https://opensource.org/license/EPL-2.0 + + + + https://github.com/metosin/signaali + scm:git:git://github.com/metosin/signaali.git + scm:git:ssh://git@github.com/metosin/signaali.git + main + + + + org.clojure + clojure + 1.10.3 + + + + src + + + + clojars + https://repo.clojars.org/ + + +