Skip to content

Commit

Permalink
Adds v to version (#454)
Browse files Browse the repository at this point in the history
* Adds v prefix to version

* Adds v prefix to version

* Standard artefact name

* Check for valid tag

* Add version variable
  • Loading branch information
digiserg authored Sep 25, 2024
1 parent 883624f commit c3b705e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/check-valid-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Tagging
on:
push:
tags:
- '*'
jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Fail if tag is not prefixed by v
run: |
if [[ $GITHUB_REF_NAME =~ ^v[0-9]+\.[0-9]+\.[0-9].* ]]; then
echo "Valid version format"
else
echo "Invalid version format"
exit 1
fi
23 changes: 13 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ jobs:

- name: Change the package.json version to match the tag
run: |
sed -i.bak 's/"version": "[^"]*"/"version": "'"$GITHUB_REF_NAME"'"/' package.json && rm package.json.bak
VERSION=$(echo $GITHUB_REF_NAME | sed 's/^v//g')
echo "VERSION=${VERSION}" >> $GITHUB_ENV
sed -i.bak 's/"version": "[^"]*"/"version": "'"$VERSION"'"/' package.json && rm package.json.bak
rm -f package.json.bak
Expand Down Expand Up @@ -163,8 +165,8 @@ jobs:
- name: Build signed installer
if: runner.os == 'Windows'
run: |
azuresigntool.exe sign --verbose -kvu ${{ secrets.AZURE_KEY_VAULT_URI }} -kvc ${{ secrets.AZURE_KEYVAULT_CERT_NAME }} -kva %AZ_TOKEN% -fd sha256 -tr http://timestamp.digicert.com -v "dist/AxonOps Workbench-%GITHUB_REF_NAME%-win-x64.exe"
azuresigntool.exe sign --verbose -kvu ${{ secrets.AZURE_KEY_VAULT_URI }} -kvc ${{ secrets.AZURE_KEYVAULT_CERT_NAME }} -kva %AZ_TOKEN% -fd sha256 -tr http://timestamp.digicert.com -v "dist/AxonOps Workbench-%GITHUB_REF_NAME%-win-x64.msi"
azuresigntool.exe sign --verbose -kvu ${{ secrets.AZURE_KEY_VAULT_URI }} -kvc ${{ secrets.AZURE_KEYVAULT_CERT_NAME }} -kva %AZ_TOKEN% -fd sha256 -tr http://timestamp.digicert.com -v "dist/AxonOps Workbench-%VERSION%-win-x64.exe"
azuresigntool.exe sign --verbose -kvu ${{ secrets.AZURE_KEY_VAULT_URI }} -kvc ${{ secrets.AZURE_KEYVAULT_CERT_NAME }} -kva %AZ_TOKEN% -fd sha256 -tr http://timestamp.digicert.com -v "dist/AxonOps Workbench-%VERSION%-win-x64.msi"
shell: cmd

# Ensure this task is right before the Upload
Expand Down Expand Up @@ -236,7 +238,8 @@ jobs:

- name: Make changes to Homebrew
run: |
VERSION=$GITHUB_REF_NAME
VERSION=$(echo $GITHUB_REF_NAME | sed 's/^v//g')
echo "VERSION=$VERSION" >> $GITHUB_ENV
case $VERSION in
*internal*)
NAME=axonopsworkbench-internal
Expand Down Expand Up @@ -301,8 +304,8 @@ jobs:

- name: Make changes to chocolatey
run: |
set -x
VERSION=$GITHUB_REF_NAME
VERSION=$(echo $GITHUB_REF_NAME | sed 's/^v//g')
echo "VERSION=$VERSION" >> $GITHUB_ENV
cd chocolatey
git config user.name "GitHub Actions"
git config user.email "[email protected]"
Expand Down Expand Up @@ -374,16 +377,16 @@ jobs:
if: env.PUBLISH == 'yes'
run: |
for arch in ${{ env.DEBIAN_ARCHS }}; do
curl -sLO "https://github.com/axonops/axonops-workbench-cassandra/releases/download/$GITHUB_REF_NAME/AxonOps.Workbench-$GITHUB_REF_NAME-linux-${arch}.deb"
curl -sLO "https://github.com/axonops/axonops-workbench-cassandra/releases/download/$VERSION/AxonOps.Workbench-$VERSION-linux-${arch}.deb"
gcloud config set project axonops-public
gcloud artifacts apt upload axonops-apt-${env.REPO_SUFFIX} --location=europe --source=AxonOps.Workbench-$GITHUB_REF_NAME-linux-${arch}.deb
gcloud artifacts apt upload axonops-apt-${env.REPO_SUFFIX} --location=europe --source=AxonOps.Workbench-$VERSION-linux-${arch}.deb
done
- name: Push RedHat package
if: env.PUBLISH == 'yes'
run: |
for arch in ${{ env.REDHAT_ARCHS }}; do
curl -sLO "https://github.com/axonops/axonops-workbench-cassandra/releases/download/$GITHUB_REF_NAME/AxonOps.Workbench-$GITHUB_REF_NAME-linux-${arch}.rpm"
curl -sLO "https://github.com/axonops/axonops-workbench-cassandra/releases/download/$VERSION/AxonOps.Workbench-$VERSION-linux-${arch}.rpm"
gcloud config set project axonops-public
gcloud artifacts yum upload axonops-yum-${env.REPO_SUFFIX} --location=europe --source=AxonOps.Workbench-$GITHUB_REF_NAME-linux-${arch}.rpm
gcloud artifacts yum upload axonops-yum-${env.REPO_SUFFIX} --location=europe --source=AxonOps.Workbench-$VERSION-linux-${arch}.rpm
done
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
"provider": "github"
}
],
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}",
"artifactName": "AxonOps.Workbench-${version}-${os}-${arch}.${ext}",
"win": {
"icon": "./renderer/assets/images/axonops-icon-256x256.ico",
"target": [
"nsis",
"msi"
],
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}"
"artifactName": "AxonOps.Workbench-${version}-${os}-${arch}.${ext}"
},
"linux": {
"icon": "./renderer/assets/images/",
Expand All @@ -49,7 +49,7 @@
"Keywords": "cassandra;axonops;development;workbench",
"Icon": "/usr/share/icons/hicolor/256x256/apps/axonops-workbench.png"
},
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}"
"artifactName": "AxonOps.Workbench-${version}-${os}-${arch}.${ext}"
},
"mac": {
"icon": "./renderer/assets/images/axonops-icon-512x512.icns",
Expand Down

0 comments on commit c3b705e

Please sign in to comment.