-
-
Notifications
You must be signed in to change notification settings - Fork 145
127 lines (110 loc) · 3.67 KB
/
continuous-deployment-workflow.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: cd
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
jobs:
test:
name: Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@12.5
with:
cli: 'latest'
bb: 'latest'
- name: Cache clojure dependencies
uses: actions/cache@v3
with:
path: |
~/.m2/repository
~/.gitlibs
~/.deps.clj
~/.npm
.shadow-cljs
key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }}
restore-keys: cljdeps-
- name: Fix git dubious directory ownership error
run: git config --global --add safe.directory /__w/re-com/re-com
- run: lein prod-once
- name: Slack notification
uses: homoluctus/slatify@v2.0.1
if: failure() || cancelled()
with:
type: ${{ job.status }}
job_name: re-com Tests
channel: '#oss-robots'
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
release:
name: Release
needs: test
runs-on: ubuntu-22.04
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
steps:
- uses: actions/checkout@v1
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@12.5
with:
cli: 'latest'
bb: 'latest'
- name: Cache clojure dependencies
uses: actions/cache@v3
with:
path: |
~/.m2/repository
~/.gitlibs
~/.deps.clj
~/.npm
.shadow-cljs
key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }}
restore-keys: cljdeps-
- run: lein release
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# This creates a 'GitHub Release' from the tag and includes link to CHANGELOG.md at the current
# git ref. We do not use draft or prerelease features as we always want
# the latest release to show in the right hand column of the project page regardless
# of if it is a stable release.
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
[Changelog](https://github.com/day8/re-com/blob/master/CHANGELOG.md)
draft: false
prerelease: false
- name: Slack notification
uses: homoluctus/slatify@v2.0.1
if: always()
with:
type: ${{ job.status }}
job_name: re-com Deployment
channel: '#oss-robots'
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}