Skip to content

Commit

Permalink
Github action - release
Browse files Browse the repository at this point in the history
  • Loading branch information
green-coder committed Jan 4, 2025
1 parent 09093a1 commit 68b709a
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 12 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}"
34 changes: 22 additions & 12 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -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
39 changes: 39 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<groupId>fi.metosin</groupId>
<artifactId>signaali</artifactId>
<version>0.1.0</version>
<name>signaali</name>
<description>Small, portable & flexible implementation of signals</description>
<inceptionYear>2023</inceptionYear>
<licenses>
<license>
<name>EPL-2.0</name>
<url>https://opensource.org/license/EPL-2.0</url>
</license>
</licenses>
<scm>
<url>https://github.com/metosin/signaali</url>
<connection>scm:git:git://github.com/metosin/signaali.git</connection>
<developerConnection>scm:git:ssh://[email protected]/metosin/signaali.git</developerConnection>
<tag>main</tag>
</scm>
<dependencies>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<version>1.10.3</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
</build>
<repositories>
<repository>
<id>clojars</id>
<url>https://repo.clojars.org/</url>
</repository>
</repositories>
</project>

0 comments on commit 68b709a

Please sign in to comment.