Skip to content

More autobuild

More autobuild #3

Workflow file for this run

name: Build and publish (pre)release
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code with all commits
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
run: |
sudo chmod 777 /opt
mkdir -p /opt/go /opt/go-win7
echo Installing Go
curl -L https://go.dev/dl/go1.24.0.linux-amd64.tar.gz -o go.tar.gz
tar -xzf go.tar.gz -C /opt
sudo ln -f -s /opt/go/bin/go /usr/bin/go
echo Installing Go for Windows 7 compatibility
curl -L https://github.com/XTLS/go-win7/releases/download/patched-1.24.0/go-for-win7-linux-amd64.zip -o go-win7.zip
unzip -qq go-win7.zip -d /opt/go-win7
sudo ln -f -s /opt/go-win7/bin/go /usr/bin/go-win7
echo Testing ...
ls -l /usr/bin/go*
ls -l /opt/go/
ls -l /opt/go/bin/
which go
which go-win7
ls -l `which go`
ls -l `which go-win7`
- name: Download cyclonedx-gomod
uses: CycloneDX/gh-gomod-generate-sbom@v2
with:
version: v1
- name: Build
run: ./build.ps1
shell: pwsh
- name: Create tag "devbuild" for current commit
uses: rickstaa/action-create-tag@v1
if: startsWith(github.ref, 'refs/tags/') != true
id: "tag_create"
with:
tag: "devbuild"
tag_exists_error: false
message: "Latest development build"
- name: Remove latest devbuild
uses: liudonghua123/delete-release-action@v1
with:
release_name: "devbuild"
- name: Pre-release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') != true
with:
tag_name: "devbuild"
prerelease: true
generate_release_notes: true
files: |
binaries/*
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
files: |
binaries/*