-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (78 loc) · 3.29 KB
/
provider-services.yaml
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: provider-services
on:
workflow_dispatch:
inputs:
tag:
jobs:
commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install gomplate
run: |
curl -o /usr/local/bin/gomplate -sSL https://github.com/hairyhenderson/gomplate/releases/download/v3.11.3/gomplate_linux-amd64
chmod 755 /usr/local/bin/gomplate
- name: get version
run: echo "RELEASE_TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
- name: set env
shell: bash
run: |
RELEASE_VERSION=${{ env.RELEASE_TAG }}
echo "RELEASE_VERSION=${RELEASE_VERSION#v}" >> $GITHUB_ENV
echo "FORMULA_FILE=akash-provider-services.rb" >> $GITHUB_ENV
- name: download checksums
uses: robinraju/[email protected]
with:
repository: akash-network/provider
latest: false
tag: ${{ env.RELEASE_TAG }}
fileName: "*.txt"
tarBall: false
zipBall: false
token: ${{ secrets.GORELEASER_ACCESS_TOKEN }}
- name: dump checksums
run: |
DARWIN_ALL_CHECKSUM=$(cat provider-services_${{ env.RELEASE_VERSION }}_checksums.txt | grep "provider-services_darwin_all.zip" 2>/dev/null | tr '\t' ' ' | cut -d ' ' -f 1)
LINUX_AMD64_CHECKSUM=$(cat provider-services_${{ env.RELEASE_VERSION }}_checksums.txt | grep "provider-services_linux_amd64.zip" 2>/dev/null | tr '\t' ' ' | cut -d ' ' -f 1)
LINUX_ARM64_CHECKSUM=$(cat provider-services_${{ env.RELEASE_VERSION }}_checksums.txt | grep "provider-services_linux_arm64.zip" 2>/dev/null | tr '\t' ' ' | cut -d ' ' -f 1)
echo "DARWIN_ALL_CHECKSUM=${DARWIN_ALL_CHECKSUM}" >> $GITHUB_ENV
echo "LINUX_AMD64_CHECKSUM=${LINUX_AMD64_CHECKSUM}" >> $GITHUB_ENV
echo "LINUX_ARM64_CHECKSUM=${LINUX_ARM64_CHECKSUM}" >> $GITHUB_ENV
- name: render formula
run:
gomplate -f templates/provider-services.rb.tmpl > ${{ env.FORMULA_FILE }}
- name: commit formula
uses: EndBug/add-and-commit@v9
with:
add: ${{ env.FORMULA_FILE }}
default_author: github_actor
message: 'feat: ${{ env.FORMULA_FILE }} ${{ env.RELEASE_TAG }}'
push: true
test-macos:
needs: commit
runs-on: macos-latest
steps:
- name: install prerequisites
run: |
brew update
brew install jq
- name: set env
shell: bash
run: |
RELEASE_VERSION=${{ github.event.inputs.tag }}
echo "RELEASE_VERSION=${RELEASE_VERSION#v}" >> $GITHUB_ENV
echo "FORMULA_NAME=akash-provider-services" >> $GITHUB_ENV
- name: install provider-services
shell: bash
run: |
brew tap akash-network/homebrew-tap
brew install ${{ env.FORMULA_NAME }}
installed_version=$(brew info ${{ env.FORMULA_NAME }} --json | jq -r '.[].versions.stable')
echo "INSTALLED_VERSION=${installed_version}" >> $GITHUB_ENV
- name: validate version
shell: bash
run: |
if [[ "${{ env.RELEASE_VERSION }}" != "${{ env.INSTALLED_VERSION }}" ]]; then
echo "::error installed version does not match. expected ${{ env.RELEASE_VERSION }}, installed ${{ env.INSTALLED_VERSION }}"
exit 1
fi