Feature Delete (#10) #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
name: Build and Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22' # Specify the Go version | |
- name: Get dependencies | |
run: go mod tidy | |
- name: Build binary and set main.Version and main.BuildTime | |
env: | |
CGO_ENABLED: 0 | |
run: | | |
TAG_NAME=${GITHUB_REF#refs/tags/} | |
BUILD_TIME=$(date +%Y-%m-%dT%H:%M:%SZ) | |
GOOS=linux GOARCH=amd64 go build -ldflags="-w -s -X main.Version=${TAG_NAME} -X main.BuildTime=${BUILD_TIME}" -o iot-ephemeral-value-store-server main.go | |
chmod +x iot-ephemeral-value-store-server | |
- name: Package files | |
run: tar czvf iot-ephemeral-value-store-server.tar.gz iot-ephemeral-value-store-server | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./iot-ephemeral-value-store-server.tar.gz | |
asset_name: iot-ephemeral-value-store-server.tar.gz | |
asset_content_type: application/gzip |