Skip to content

Merge pull request #9 from jkandasa/cli_implementation #1

Merge pull request #9 from jkandasa/cli_implementation

Merge pull request #9 from jkandasa/cli_implementation #1

name: publish executables
on:
push:
branches: [main]
tags: ["v*"]
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: checkout the source code
uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ^1.21
- name: Cache go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: build executable bundles
run: ./scripts/generate_executables.sh
- name: generate a build timestamp and sha256sum files
run: |
cd builds
echo `date -u +'%Y%m%d%H%M%S'` > ./build_timestamp.txt
echo `date -u +'%Y-%m-%dT%H:%M:%S%:z'` >> ./build_timestamp.txt
sha256sum *.tar.gz > ./SHA256SUMS.txt
sha256sum *.zip >> ./SHA256SUMS.txt
- name: update release notes and executables
if: startsWith(github.ref, 'refs/tags/') # executes only for new release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
files: |
builds/*.tar.gz
builds/*.zip
builds/build_timestamp.txt
builds/SHA256SUMS.txt
- name: Update executables for main branch changes
if: startsWith(github.ref, 'refs/heads/main') # executes only for changes in main
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GH_TOKEN }}"
automatic_release_tag: development
prerelease: true
title: "Development Build - Pre Release"
files: |
builds/*.tar.gz
builds/*.zip
builds/build_timestamp.txt
builds/SHA256SUMS.txt