forked from irinazheltisheva/powergate
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (136 loc) · 4.6 KB
/
Copy pathrelease.yml
File metadata and controls
136 lines (136 loc) · 4.6 KB
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
133
134
135
136
name: Release
on:
release:
types: [published]
jobs:
publish_docker:
name: Publish Docker Compose Setup
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Get latest tag
id: latesttag
uses: "WyriHaximus/github-action-get-previous-tag@master"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Update powergate image version
run: sed -i.bak 's/latest/${{steps.latesttag.outputs.tag}}/g' docker/powergate-image.yaml
- name: Update Makefile
run: sed -i.bak 's/powergate-build-context/powergate-image/g' docker/Makefile
- name: Remove sed backups
run: rm -rf docker/*.bak
- name: Create archive
run: |
mv docker powergate-docker-${{steps.latesttag.outputs.tag}}
zip -r powergate-docker-${{steps.latesttag.outputs.tag}}.zip powergate-docker-${{steps.latesttag.outputs.tag}}
- name: Upload artifacts to release
uses: AButler/upload-release-assets@v2.0
with:
files: "powergate-docker-${{steps.latesttag.outputs.tag}}.zip"
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-platform-builds:
name: Release Builds
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.14
- name: Check out code
uses: actions/checkout@v1
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
export PATH=${PATH}:`go env GOPATH`/bin
go get -v -t -d ./...
- name: Build release artifacts
run: |
POW_VERSION=${GITHUB_REF##*/} make build-releases
echo $(ls ./build/dist/)
- name: Upload multiple assets to release
uses: AButler/upload-release-assets@v2.0
with:
files: "build/dist/*;iplocation/maxmind/GeoLite2-City.mmdb"
repo-token: ${{ secrets.GITHUB_TOKEN }}
publish_js_grpc_lib:
name: Publish JS gRPC bindings
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Get latest tag
id: latesttag
uses: "WyriHaximus/github-action-get-previous-tag@master"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
- name: Install protoc
uses: arduino/setup-protoc@master
with:
version: "3.11.2"
- name: Make version number
id: makeversion
uses: frabert/replace-string-action@v1.1
with:
pattern: "v"
string: ${{steps.latesttag.outputs.tag}}
replace-with: ""
- name: Generate JS gRPC bindings
run: |
./scripts/gen-js-protos.sh ${{steps.makeversion.outputs.replaced}} . ./js-grpc
- name: Publish JS gRPC bindings
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: |
npm publish --access=public
working-directory: ./js-grpc
publish_py_grpc_lib:
name: Publish Python gRPC bindings
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Get latest tag
id: latesttag
uses: "WyriHaximus/github-action-get-previous-tag@master"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Make version number
id: makeversion
uses: frabert/replace-string-action@v1.1
with:
pattern: "v"
string: ${{steps.latesttag.outputs.tag}}
replace-with: ""
- name: Generate Python gRPC bindings
run: |
./scripts/gen-py-protos.sh ${{steps.makeversion.outputs.replaced}} . ./py-grpc
- name: Publish Python gRPC bindings
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python3 -m pip install --user --upgrade twine
python3 -m twine upload dist/*
working-directory: ./py-grpc