Skip to content

Commit

Permalink
try new workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Schmidt committed Jul 9, 2024
1 parent 48050d4 commit 6d374fe
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/create-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ name: Build and Create Pre-Release
on:
workflow_dispatch:
inputs:
addCommit:
description: 'Dev build?'
version:
description: 'If this is release what version is this for? If this is a pre-release what version are you developing toward?'
required: false
type: string
preRelease:
description: 'Create Pre-release? SNAPSHOT will appended to the version above.'
required: false
type: boolean
deletePrevBuild:
description: 'Delete existing pre-releases?'
required: false
type: boolean
tag:
description: 'If not a dev build, should we tag?'
required: false
type: string


# push:
# branches:
Expand Down Expand Up @@ -50,14 +51,20 @@ jobs:
cd /Volumes/Packages
sudo installer -pkg Install\ Packages.pkg -target /
- name: Tag Before Building
if: inputs.tag != ''
if: inputs.version != ''
env:
TAG: ${{ inputs.tag }}
TAG: ${{ inputs.version }}
SNAPSHOT: ${{ inputs.preRelease }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Tagging the repository with ${TAG}"
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
if [ "${SNAPSHOT}" = "true" ]; then
COMMIT=$(git rev-parse --short HEAD)
TAG="${TAG}-SNAPSHOT-${COMMIT}"
fi
# Ensure the tag does not already exist
if ! gh release view "${TAG}" > /dev/null 2>&1; then
Expand All @@ -71,23 +78,23 @@ jobs:
- name: "Compile"
env:
ADDCOMMIT: ${{ inputs.addCommit }}
ADDCOMMIT: ${{ inputs.preRelease }}
run: |
buildcmd="build-prerelease"
[ "${ADDCOMMIT}" = "false" ] && buildcmd="build-official"
export PATH=$PATH:/usr/local/bin:/usr/local/go/bin
cd ~/work/asvec/asvec && make cleanall && make ${buildcmd}
- name: "Create linux packages"
env:
ADDCOMMIT: ${{ inputs.addCommit }}
ADDCOMMIT: ${{ inputs.preRelease }}
run: |
buildcmd="build-prerelease"
[ "${ADDCOMMIT}" = "false" ] && buildcmd="build-official"
export PATH=$PATH:/usr/local/bin:/usr/local/go/bin
cd ~/work/asvec/asvec && make pkg-linux
- name: "Create windows zips"
env:
ADDCOMMIT: ${{ inputs.addCommit }}
ADDCOMMIT: ${{ inputs.preRelease }}
run: |
buildcmd="build-prerelease"
[ "${ADDCOMMIT}" = "false" ] && buildcmd="build-official"
Expand Down Expand Up @@ -130,10 +137,8 @@ jobs:
- name: "Create a new pre-release"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ADDCOMMIT: ${{ inputs.addCommit }}
run: |
set -e
echo "${ADDCOMMIT}"
cd ~/work/asvec/asvec/bin/packages
VER=$(cat ../../VERSION.md)
RPM_VER=$(echo ${VER} | sed 's/-/_/g')
Expand Down

0 comments on commit 6d374fe

Please sign in to comment.