updated releaser #5
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: goreleaser | |
on: | |
push: | |
# run only against tags | |
tags: | |
- "v*" | |
permissions: | |
contents: write | |
# packages: write | |
# issues: write | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- name: pull repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: git fetch | |
run: git fetch --force --tags | |
- name: setup go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: stable | |
- name: set version in main.go | |
run: sed -i "s/rest.StartServer(c.Port, \"1.0.0\")/rest.StartServer(c.Port, \"$(git tag | sort -Vr | head -n 1)\")/g" $PWD/main.go | |
- name: build go | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean --skip-publish --skip-validate | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: innosetup | |
run: | | |
cp ./dist/hyper-v-rest-ps_windows_amd64_v1/hyper-v-rest-ps.exe packaging/hyper-v-rest-ps.exe | |
cd packaging/ | |
docker build . --security-opt label=disable -t inno:64bit | |
bash ./iscc.sh 64 innosetup.iss | |
mv hyper-v-rest-ps.exe hyper-v-rest-ps-portable.exe | |
- name: upload release | |
id: create_release | |
uses: marvinpinto/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
title: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
files: | | |
./packaging/hyper-v-rest-ps-portable.exe | |
./packaging/Output/hyper-v-rest-ps-setup.exe |