Skip to content

Commit

Permalink
Merge pull request #3 from liquidz/dev
Browse files Browse the repository at this point in the history
ver 0.2.2
  • Loading branch information
liquidz committed May 6, 2020
2 parents 42f462c + ca23306 commit f1293ac
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: static
on: [pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.1.0
- name: version check
run: bash script/version_check.sh
7 changes: 7 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. This change

== Unreleased (dev)

== 0.2.2 (2020-05-07)
// {{{
=== Fixed
* Fixed to handle `master` version as a release version.
* Fixed to fetch correct releases.atom for GitHub Actions.
// }}}

== 0.2.1 (2020-05-07)
// {{{
=== Fixed
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ install: clean target/antq.jar
clj -R:deploy -m deps-deploy.deps-deploy install target/antq.jar

deploy: clean target/antq.jar
echo "Testing if CLOJARS_USERNAME environmental variable exists."
test $(CLOJARS_USERNAME)
clj -A:deploy

docker:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>antq</groupId>
<artifactId>antq</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>
<name>antq</name>
<description>Point out your outdated dependencies</description>
<url>https://github.com/liquidz/antq</url>
Expand Down
10 changes: 10 additions & 0 deletions script/version_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

SCRIPT_DIR=$(cd $(dirname $0); pwd)
VERSION=$(grep '<version>' ${SCRIPT_DIR}/../pom.xml | head -n1 | sed 's/ *<[^>]*>//g')

grep "== ${VERSION}" ${SCRIPT_DIR}/../CHANGELOG.adoc
if [ $? -ne 0 ]; then
echo 'version_check: There is no corresponding section in CHANGELOG'
exit 1
fi
2 changes: 1 addition & 1 deletion src/antq/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

(defn using-release-version?
[dep]
(contains? #{"RELEASE"} (:version dep)))
(contains? #{"RELEASE" "master"} (:version dep)))

(defn latest?
[dep]
Expand Down
4 changes: 3 additions & 1 deletion src/antq/ver/github_action.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
[antq.util.xml :as u.xml]
[antq.ver :as ver]
[clojure.data.xml :as xml]
[clojure.string :as str]
[version-clj.core :as version]))

(defn releases-atom
[dep]
(format "https://github.com/%s/releases.atom" (:name dep)))
(format "https://github.com/%s/releases.atom"
(str/join "/" (take 2 (str/split (:name dep) #"/")))))

(defn get-latest-version-by-url*
[url]
Expand Down
9 changes: 9 additions & 0 deletions test/antq/ver/github_action_test.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(ns antq.ver.github-action-test
(:require
[antq.ver.github-action :as sut]
[clojure.test :as t]))

(t/deftest releases-atom-test
(t/are [expected in] (= expected (sut/releases-atom {:name in}))
"https://github.com/foo/bar/releases.atom" "foo/bar"
"https://github.com/foo/bar/releases.atom" "foo/bar/baz"))

0 comments on commit f1293ac

Please sign in to comment.