-
Notifications
You must be signed in to change notification settings - Fork 2
132 lines (116 loc) · 3.33 KB
/
brew.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
128
129
130
131
132
name: Build and release Nosana Node packages
on:
push:
tags:
- v*
permissions:
contents: write
jobs:
##############
# BUILD
build:
name: Build package
runs-on: ubuntu-latest
steps:
# repo
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
# java
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 19
# clojure
- name: Setup clojure
uses: DeLaGuardo/[email protected]
with:
cli: latest
# build
- name: Compile uberjar
run: clojure -X:compile uberjar
# artifact
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: nosana-node
path: target/*.jar
if-no-files-found: error
##############
# RELEASE
release:
name: Release package
needs: build
runs-on: ubuntu-latest
env:
RELEASE_BODY_FILE: body.txt
outputs:
version: ${{ steps.prepare.outputs.version }}
sha256: ${{ steps.prepare.outputs.sha256 }}
steps:
# repo
- name: Checkout repository
uses: actions/checkout@v3
# artifact
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
# changelog
- name: Generate changelog
id: changelog
uses: metcalfc/[email protected]
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
# prepare
- name: Prepare release files
id: prepare
run: .github/scripts/prepare-release.sh
env:
TAG_REF: ${{ github.ref }}
CHANGE_LOG: ${{ steps.changelog.outputs.changelog }}
# release
- name: Release package
uses: softprops/action-gh-release@v1
with:
body_path: ${{ env.RELEASE_BODY_FILE }}
files: release/*
draft: false
prerelease: false
##############
# UPDATE
update:
name: Update Brew
needs: release
runs-on: ubuntu-latest
env:
VERSION: ${{ needs.release.outputs.version }}
SHA256: ${{ needs.release.outputs.sha256 }}
steps:
# remote repo
- name: Checkout brew sources
uses: actions/checkout@v3
with:
repository: nosana-ci/homebrew-tools
# update formula
- name: Update formula
id: update-formula
run: scripts/update-formula.sh nosana-node.rb ${{ env.VERSION }} ${{ env.SHA256 }}
# create PR
- name: Create PR
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.BOT_GITHUB_PAT_PUBLIC_REPO }}
commit-message: Update nosana-node formula to version ${{ env.VERSION }}
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
base: main
branch: update-nosana-node-cli-formula
delete-branch: true
title: Nosana Node brew update ${{ env.VERSION }}
body: |
This PR
- Updates `nosana-node` formula to version `${{ env.VERSION }}`
- Package sha256 is `${{ env.SHA256 }}`
- Auto-generated from [nosana-ci Continuous Delivery workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})