-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jesse Schmidt
committed
Jul 8, 2024
1 parent
c7e7e95
commit 48050d4
Showing
1 changed file
with
29 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,14 @@ on: | |
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: | ||
- "actions-hub" # remove before merge into main | ||
# push: | ||
# branches: | ||
# - "actions-hub" # remove before merge into main | ||
jobs: | ||
build-and-release: | ||
runs-on: macos-13 | ||
|
@@ -45,6 +49,26 @@ jobs: | |
hdiutil attach -mountpoint /Volumes/Packages Packages.dmg | ||
cd /Volumes/Packages | ||
sudo installer -pkg Install\ Packages.pkg -target / | ||
- name: Tag Before Building | ||
if: inputs.tag != '' | ||
env: | ||
TAG: ${{ inputs.tag }} | ||
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" | ||
# Ensure the tag does not already exist | ||
if ! gh release view "${TAG}" > /dev/null 2>&1; then | ||
git tag -a "${TAG}" -m "Release ${TAG}" | ||
git push origin "${TAG}" | ||
echo "Tag ${TAG} created and pushed successfully." | ||
else | ||
echo "Tag ${TAG} already exists." | ||
fi | ||
- name: "Compile" | ||
env: | ||
ADDCOMMIT: ${{ inputs.addCommit }} | ||
|
@@ -111,14 +135,11 @@ jobs: | |
set -e | ||
echo "${ADDCOMMIT}" | ||
cd ~/work/asvec/asvec/bin/packages | ||
COMMIT=$(git rev-parse --short HEAD) | ||
VER=$(cat ../../VERSION.md) | ||
RPM_VER=$(echo ${VER} | sed 's/-/_/g') | ||
BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
TAG=${VER}-${COMMIT} | ||
[ "${ADDCOMMIT}" = "false" ] && TAG=${VER} | ||
TAG=${VER} | ||
FULLCOMMIT=$(git rev-parse HEAD) | ||
gh release create -R github.com/aerospike/asvec --notes-file ../../RELEASE.md --prerelease --target ${FULLCOMMIT} --title "Asvec - v${TAG}" ${TAG} asvec-linux-amd64-${VER}.deb asvec-linux-amd64-${RPM_VER}.rpm asvec-linux-amd64-${VER}.zip asvec-linux-arm64-${VER}.deb asvec-linux-arm64-${RPM_VER}.rpm asvec-linux-arm64-${VER}.zip asvec-macos-${VER}.pkg asvec-macos-amd64-${VER}.zip asvec-macos-arm64-${VER}.zip asvec-windows-amd64-${VER}.zip asvec-windows-arm64-${VER}.zip | ||
gh release create -R github.com/aerospike/asvec --notes-file ../../RELEASE.md --prerelease --target ${FULLCOMMIT} --title "Asvec - ${TAG}" ${TAG} asvec-linux-amd64-${VER}.deb asvec-linux-amd64-${RPM_VER}.rpm asvec-linux-amd64-${VER}.zip asvec-linux-arm64-${VER}.deb asvec-linux-arm64-${RPM_VER}.rpm asvec-linux-arm64-${VER}.zip asvec-macos-${VER}.pkg asvec-macos-amd64-${VER}.zip asvec-macos-arm64-${VER}.zip asvec-windows-amd64-${VER}.zip asvec-windows-arm64-${VER}.zip | ||
- name: "Delete previous pre-release" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|