81 lines (66 loc) · 2.23 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Release
on:
workflow_dispatch:
jobs:
release:
environment: release
runs-on: ubuntu-latest
# I do not know of a way to restrict to the main branch so try to skip the whole job if
# user selected some other branch from GitHub Actions GUI
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Git User so that we can later commit
uses: fregante/setup-git-user@v1
- name: Clojure deps cache
uses: actions/cache@v2
with:
path: |
~/.m2/repository
~/.gitlibs
key: $${ runner.os }}-cljdeps-release-${{ hashFiles('deps.edn') }}
restore-keys: $${ runner.os }}-cljdeps-release-
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- name: Install Babashka
run: curl -s https://raw.githubusercontent.com/borkdude/babashka/master/install | sudo bash
- name: Install Clojure
run: curl -s https://download.clojure.org/install/linux-install-1.10.3.933.sh | sudo bash
- name: Tools Versions
run: |
echo "bb --version"
bb --version
echo "node --version"
node --version
echo "java -version"
java -version
echo "clojure -Sdescribe"
clojure -Sdescribe
- name: Download Clojure Dependencies
run: clojure -Spath
- name: Release Prep (step 1 of 4)
run: bb ci-release prep
- name: Release Deploy (step 2 of 4)
env:
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
run: bb ci-release deploy-remote
- name: Release Commit (step 3 of 4)
run: bb ci-release commit
- name: Make GitHub Actions aware of target version tag
run: echo "::set-output name=tag::v$(cat ./target/target-version.txt)"
id: target-version
- name: Create GitHub release (step 4 of 4)
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.target-version.outputs.tag}}
release_name: ${{ steps.target-version.outputs.tag}}
commitish: main