From ec73e1aad566fc0b64ce38a522736b77e023d84c Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 21 Mar 2020 21:09:15 +0100 Subject: [PATCH] add release workflow --- .github/workflows/release.yaml | 56 ++++++++++++++++++++++++++++++++++ Makefile | 2 +- go.mod | 5 +++ go.sum | 8 +++++ 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yaml create mode 100644 go.sum diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..e042f01 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,56 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup go + uses: actions/setup-go@v1 + with: + go-version: '1.14.x' + - name: Create release artifacts + run: make release + - name: Create Github Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false + - name: Upload release artifacts (Mac OS amd64) + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: build/prometheus-jitsi-meet-exporter-${{ github.ref }}-darwin-amd64 + asset_content_type: application/octet-stream + - name: Upload release artifacts (FreeBSD amd64) + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: build/prometheus-jitsi-meet-exporter-${{ github.ref }}-freebsd-amd64 + asset_content_type: application/octet-stream + - name: Upload release artifacts (Linux amd64) + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: build/prometheus-jitsi-meet-exporter-${{ github.ref }}-freebsd-amd64 + asset_content_type: application/octet-stream diff --git a/Makefile b/Makefile index 40550cb..373a7b8 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ GOGET = $(GOCMD) get GIT_VERSION := $(shell git --no-pager describe --tags --always) GIT_COMMIT := $(shell git rev-parse --verify HEAD) -GOX_ARGS = -output="$(BUILD_DIR)/{{.Dir}}-${GIT_VERSION}-{{.OS}}-{{.Arch}}" -osarch="linux/amd64 linux/arm linux/arm64 darwin/amd64 freebsd/amd64" +GOX_ARGS = -output="$(BUILD_DIR)/{{.Dir}}-${GIT_VERSION}-{{.OS}}-{{.Arch}}" -osarch="linux/amd64 darwin/amd64 freebsd/amd64" BUILD_DIR = build BINARY_NAME = prometheus-jitsi-meet-exporter diff --git a/go.mod b/go.mod index c3fae30..a5c5476 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,8 @@ module github.com/systemli/prometheus-jitsi-meet-exporter go 1.14 + +require ( + github.com/hashicorp/go-version v1.2.0 // indirect + github.com/mitchellh/gox v1.0.1 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..7fccc53 --- /dev/null +++ b/go.sum @@ -0,0 +1,8 @@ +github.com/hashicorp/go-version v1.0.0 h1:21MVWPKDphxa7ineQQTrCU5brh7OuVVAzGOCnnCPtE8= +github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI= +github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= +github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=