Skip to content

updated(github actions): Added goversioninfo into env #14

updated(github actions): Added goversioninfo into env

updated(github actions): Added goversioninfo into env #14

Workflow file for this run

name: Build and Release
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.22.3'
- name: Install dependencies
run: go mod tidy
- name: Install goversioninfo
run: go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest
- name: Add Go bin to PATH
run: echo "${{ runner.tool_cache }}/go/$(go version | awk '{print $3}')/bin" >> $GITHUB_PATH
- name: Generate .syso
run: go generate .\cmd\
- name: Build application
run: go build -ldflags="-H windowsgui -extldflags=-Wl,app.manifest" -o memory-cleaner-tray.exe .\cmd\
- name: Archive build
uses: actions/upload-artifact@v2
with:
name: memory-cleaner-tray
path: memory-cleaner-tray.exe
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: memory-cleaner-tray
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: memory-cleaner-tray.exe
asset_name: memory-cleaner-tray.exe
asset_content_type: application/octet-stream