Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a GitHub Action workflow for releasing #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Cut a new release

on:
workflow_dispatch:
inputs:
name:
description: 'Please input any text for confirmation'
required: true

jobs:
release:
needs: [clj_style, clj_kondo]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
java-package: jdk
architecture: x64

- uses: DeLaGuardo/setup-clojure@master
with:
cli: '1.10.3.1040'

- name: Show versions
run: |
java -version
clojure --version

- name: Cache dependencies
uses: toyokumo/cache@main
with:
path: |
~/.m2
key: clj-cache-${{ hashFiles('**/deps.edn') }}
restore-keys: |
clj-cache-

- name: Run tests
run: make release
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
VERSION_FILE := src/toyokumo/tools/release/version.clj
RELEASE_OPTION := :version-file ${VERSION_FILE}

.PHONY: lint
lint:
cljstyle check
Expand All @@ -10,3 +13,18 @@ test:
.PHONY: outdated
outdated:
clojure -Sdeps '{:deps {com.github.liquidz/antq {:mvn/version "RELEASE"}}}' -M -m antq.core

.PHONY: bump-minor-version
bump-minor-version:
clojure -X toyokumo.tools.release/bump-minor-version ${RELEASE_OPTION}

.PHONY: bump-major-version
bump-major-version:
clojure -X toyokumo.tools.release/bump-major-version ${RELEASE_OPTION}

.PHONY: release
release:
git checkout main
git pull
clojure -X toyokumo.tools.release/pre-prod-deploy ${RELEASE_OPTION}
clojure -X toyokumo.tools.release/post-prod-deploy ${RELEASE_OPTION}
3 changes: 2 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Common operations for releasing new version.
+
[source,clojure]
----
{:aliases {:release {:extra-deps {com.github.toyokumo/tools.release {:git/sha "..."}}
{:aliases {:release {:extra-deps {com.github.toyokumo/tools.release {:git/tag "..."
:git/sha "..."}}
:ns-default toyokumo.tools.release}}}
----
* Run task
Expand Down
6 changes: 6 additions & 0 deletions src/toyokumo/tools/release/version.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
;; This code was automatically modified by toyokumo/tools.release
;; Don't rename `version` and `generated-at`
(ns toyokumo.tools.release.version)

(def version "1.0.1-SNAPSHOT")
(def generated-at "1900-01-01T00:00:00.000Z")