-
Notifications
You must be signed in to change notification settings - Fork 32
41 lines (41 loc) · 2.56 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
on:
release:
types: [created]
name: Handle Release
jobs:
generate:
name: Create release artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@master
- name: yarn install
run: docker run --rm -v ${PWD}:/opt/gcds -w /opt/gcds node:20-alpine yarn install
- name: yarn build
run: docker run --rm -v ${PWD}:/opt/gcds -w /opt/gcds node:20-alpine yarn build
- name: go mod vendor
run: docker run --rm -v ${PWD}:/go/src/github.com/ha/gcp -w /go/src/github.com/ha/gcp/backend golang:1-alpine go mod vendor
- name: go build linux
run: docker run --rm -v ${PWD}:/go/src/github.com/ha/gcp -w /go/src/github.com/ha/gcp/backend -e CGO_ENABLED=0 golang:1-alpine go build -buildvcs=false -o ../dist/cassandra-plugin_linux_amd64 .
- name: backend tests
run: docker run --rm -v ${PWD}:/go/src/github.com/ha/gcp -w /go/src/github.com/ha/gcp/backend golang:1-alpine go test -buildvcs=false -v -vet=off ./...
- name: go build windows
run: docker run --rm -v ${PWD}:/go/src/github.com/ha/gcp -w /go/src/github.com/ha/gcp/backend -e GOOS=windows -e GOARCH=amd64 golang:1-alpine go build -buildvcs=false -o ../dist/cassandra-plugin_windows_amd64.exe .
- name: go build darwin
run: docker run --rm -v ${PWD}:/go/src/github.com/ha/gcp -w /go/src/github.com/ha/gcp/backend -e GOOS=darwin -e GOARCH=amd64 golang:1-alpine go build -buildvcs=false -o ../dist/cassandra-plugin_darwin_amd64 .
- name: go build arm64 (m1)
run: docker run --rm -v ${PWD}:/go/src/github.com/ha/gcp -w /go/src/github.com/ha/gcp/backend -e GOOS=linux -e GOARCH=arm64 golang:1-alpine go build -buildvcs=false -o ../dist/cassandra-plugin_linux_arm64 .
- name: sign the build
run: docker run --rm -v ${PWD}:/opt/gcds -w /opt/gcds -e GRAFANA_ACCESS_POLICY_TOKEN=${{ secrets.GRAFANA_ACCESS_POLICY_TOKEN }} node:20-alpine yarn sign
- name: Package plugin
id: package-plugin
run: |
mv dist/ hadesarchitect-cassandra-datasource
zip -r cassandra-datasource-${{ github.event.release.tag_name }}.zip ./hadesarchitect-cassandra-datasource
md5sum cassandra-datasource-${{ github.event.release.tag_name }}.zip > cassandra-datasource-${{ github.event.release.tag_name }}.zip.md5
- name: Upload the artifacts
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: './cassandra-datasource-${{ github.event.release.tag_name }}.*'