Skip to content

Commit dfbb77d

Browse files
authored
v1.0.2 (#257)
* install script update to make handling existing installation clearer * update installation script further, allow passing bundle for cqlsh, and resolve #254 * resolve #256 * fix #258 * fix some issues with installing external software (hopefully for real this time...) * resolve #249 * fix some tests * initial implementation of #255 * resolve #263 * More work on resolving #255 * Even more work on resolving #255... * fix bug w/ release workflow file * bump version * update ci to also build and release fat jars * more ci update work * can the ci please work now? * please 🥺 * all I want for christmas is youuuuu... to work ffs * resolve #261 * fix brew case when upgrading * bump version * some testing work * bump version * fix workflow for the millionth time * chore: update checksums and version for v1.0.2-beta.3 (#266) Co-authored-by: toptobes <[email protected]> * tiny change * try to make upgrade gateway better detect prereleases? * lil work on config path cmd * use .debug() instead of .info() for logging in a few places * bump version
1 parent fa15446 commit dfbb77d

File tree

165 files changed

+3305
-674
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+3305
-674
lines changed

.github/workflows/build.yml

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
name: build.yml
22
on:
33
workflow_call:
4+
inputs: &workflow-inputs
5+
upload-artifacts:
6+
description: 'Upload build artifacts'
7+
required: false
8+
type: boolean
9+
default: true
10+
build-native:
11+
description: 'Build for all platforms'
12+
required: false
13+
type: boolean
14+
default: false
415
workflow_dispatch:
16+
inputs: *workflow-inputs
517
push:
618
branches: [ main ]
719

820
jobs:
9-
build:
21+
build-native:
22+
if: github.event_name != 'push' && inputs.build-native
1023
strategy:
1124
matrix:
1225
os: [ ubuntu-24.04, windows-2022, ubuntu-24.04-arm, macos-15-intel, macos-14 ]
@@ -28,22 +41,21 @@ jobs:
2841
artifact-type: tar
2942

3043
runs-on: ${{ matrix.os }}
31-
44+
3245
steps:
3346
- uses: actions/checkout@v4
3447

3548
- name: Set up GraalVM
36-
uses: graalvm/setup-graalvm@v1
49+
uses: actions/setup-java@v5
3750
with:
3851
java-version: '25'
3952
distribution: 'graalvm'
40-
github-token: ${{ secrets.GITHUB_TOKEN }}
41-
native-image-job-reports: 'true'
4253

4354
- name: Setup Gradle
4455
uses: gradle/actions/setup-gradle@v4
4556
with:
4657
gradle-version: wrapper
58+
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
4759

4860
- name: Build and package native image (tar)
4961
if: matrix.artifact-type == 'tar'
@@ -54,9 +66,38 @@ jobs:
5466
run: ./gradlew nativeZip -Pprod
5567

5668
- name: Upload artifacts
69+
if: github.event_name != 'push' && inputs.upload-artifacts
5770
uses: actions/upload-artifact@v4
5871
with:
5972
name: ${{ matrix.artifact-name }}
6073
path: build/distributions/*.${{ matrix.artifact-type }}*
6174
if-no-files-found: error
62-
retention-days: 1
75+
retention-days: 7
76+
77+
build-jar:
78+
runs-on: ubuntu-24.04
79+
80+
steps:
81+
- uses: actions/checkout@v4
82+
83+
- name: Set up GraalVM
84+
uses: actions/setup-java@v5
85+
with:
86+
java-version: '25'
87+
distribution: 'graalvm'
88+
89+
- name: Setup Gradle
90+
uses: gradle/actions/setup-gradle@v4
91+
with:
92+
gradle-version: wrapper
93+
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
94+
95+
- name: Build JAR
96+
run: ./gradlew fatJar -Pprod
97+
98+
- name: Upload JAR artifact
99+
if: github.event_name != 'push' && inputs.upload-artifacts
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: astra-cli-fat-jar
103+
path: build/libs/astra-fat.jar

.github/workflows/release.yml

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,21 @@ on:
1111
required: false
1212
type: boolean
1313
default: false
14+
jar-only:
15+
description: 'Release only the fat jar'
16+
required: false
17+
type: boolean
18+
default: false
1419

1520
jobs:
16-
build:
17-
uses: ./.github/workflows/build.yml
18-
19-
release:
20-
needs: build
21+
verify:
2122
runs-on: ubuntu-latest
22-
permissions:
23-
contents: write
24-
2523
steps:
2624
- uses: actions/checkout@v4
2725

2826
- name: Verify versions are up to date
2927
run: |
3028
files=(
31-
"scripts/install.ps1"
32-
"scripts/install.sh"
3329
"build.gradle.kts"
3430
"src/test/resources/snapshots/AstraCli/help_output.human.approved.txt"
3531
)
@@ -49,22 +45,62 @@ jobs:
4945
exit 1
5046
fi
5147
48+
build:
49+
needs: verify
50+
uses: ./.github/workflows/build.yml
51+
with:
52+
upload-artifacts: true
53+
build-native: ${{ !inputs.jar-only }}
54+
55+
update-install-scripts:
56+
if: ${{ !inputs.jar-only }}
57+
needs: build
58+
uses: ./.github/workflows/update-install-scripts.yml
59+
permissions:
60+
contents: write
61+
pull-requests: write
62+
with:
63+
tag: ${{ inputs.tag }}
64+
65+
release:
66+
needs: [ build, update-install-scripts ]
67+
runs-on: ubuntu-latest
68+
permissions:
69+
contents: write
70+
71+
# https://github.com/actions/runner/issues/491#issuecomment-850884422
72+
if: always() && (needs.update-install-scripts.result == 'success' || needs.update-install-scripts.result == 'skipped')
73+
74+
steps:
5275
- name: Download all artifacts
5376
uses: actions/download-artifact@v4
5477
with:
5578
path: artifacts
5679

80+
- name: Determine artifact list
81+
id: artifact-list
82+
run: |
83+
if [ "${{ inputs.jar-only }}" = "true" ]; then
84+
echo "files=artifacts/astra-cli-fat-jar/*" >> $GITHUB_OUTPUT
85+
else
86+
{
87+
echo "files<<EOT"
88+
echo "artifacts/astra-cli-linux-x86_64/*"
89+
echo "artifacts/astra-cli-windows-x86_64/*"
90+
echo "artifacts/astra-cli-linux-arm64/*"
91+
echo "artifacts/astra-cli-macos-x86_64/*"
92+
echo "artifacts/astra-cli-macos-arm64/*"
93+
echo "artifacts/astra-cli-fat-jar/*"
94+
echo "EOT"
95+
} >> $GITHUB_OUTPUT
96+
fi
97+
5798
- name: Create Release
5899
uses: softprops/action-gh-release@v2
59100
with:
60101
tag_name: ${{ inputs.tag }}
61102
name: ${{ inputs.tag }}
62103
prerelease: ${{ inputs.prerelease }}
63-
files: |
64-
artifacts/astra-cli-linux-x86_64/*
65-
artifacts/astra-cli-windows-x86_64/*
66-
artifacts/astra-cli-linux-arm64/*
67-
artifacts/astra-cli-macos-x86_64/*
68-
artifacts/astra-cli-macos-arm64/*
104+
files: ${{ steps.artifact-list.outputs.files }}
69105
env:
70106
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: update-install-scripts.yml
2+
on:
3+
workflow_call:
4+
inputs:
5+
tag:
6+
required: true
7+
type: string
8+
9+
jobs:
10+
update-install-scripts:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Download all artifacts
22+
uses: actions/download-artifact@v4
23+
with:
24+
path: artifacts
25+
26+
- name: Calculate checksums
27+
id: checksums
28+
run: |
29+
set -euo pipefail
30+
31+
# Linux x86_64
32+
LINUX_X86_64_FILES=(artifacts/astra-cli-linux-x86_64/*.tar.gz)
33+
if [ ${#LINUX_X86_64_FILES[@]} -eq 0 ]; then
34+
echo "ERROR: No Linux x86_64 artifact found"
35+
exit 1
36+
fi
37+
LINUX_X86_64=$(sha256sum "${LINUX_X86_64_FILES[0]}" | cut -d' ' -f1)
38+
39+
# Linux ARM64
40+
LINUX_ARM64_FILES=(artifacts/astra-cli-linux-arm64/*.tar.gz)
41+
if [ ${#LINUX_ARM64_FILES[@]} -eq 0 ]; then
42+
echo "ERROR: No Linux ARM64 artifact found"
43+
exit 1
44+
fi
45+
LINUX_ARM64=$(sha256sum "${LINUX_ARM64_FILES[0]}" | cut -d' ' -f1)
46+
47+
# macOS x86_64
48+
MACOS_X86_64_FILES=(artifacts/astra-cli-macos-x86_64/*.tar.gz)
49+
if [ ${#MACOS_X86_64_FILES[@]} -eq 0 ]; then
50+
echo "ERROR: No macOS x86_64 artifact found"
51+
exit 1
52+
fi
53+
MACOS_X86_64=$(sha256sum "${MACOS_X86_64_FILES[0]}" | cut -d' ' -f1)
54+
55+
# macOS ARM64
56+
MACOS_ARM64_FILES=(artifacts/astra-cli-macos-arm64/*.tar.gz)
57+
if [ ${#MACOS_ARM64_FILES[@]} -eq 0 ]; then
58+
echo "ERROR: No macOS ARM64 artifact found"
59+
exit 1
60+
fi
61+
MACOS_ARM64=$(sha256sum "${MACOS_ARM64_FILES[0]}" | cut -d' ' -f1)
62+
63+
# Windows x86_64
64+
WINDOWS_X86_64_FILES=(artifacts/astra-cli-windows-x86_64/*.zip)
65+
if [ ${#WINDOWS_X86_64_FILES[@]} -eq 0 ]; then
66+
echo "ERROR: No Windows x86_64 artifact found"
67+
exit 1
68+
fi
69+
WINDOWS_X86_64=$(sha256sum "${WINDOWS_X86_64_FILES[0]}" | cut -d' ' -f1)
70+
71+
echo "linux_x86_64=$LINUX_X86_64" >> $GITHUB_OUTPUT
72+
echo "linux_arm64=$LINUX_ARM64" >> $GITHUB_OUTPUT
73+
echo "macos_x86_64=$MACOS_X86_64" >> $GITHUB_OUTPUT
74+
echo "macos_arm64=$MACOS_ARM64" >> $GITHUB_OUTPUT
75+
echo "windows_x86_64=$WINDOWS_X86_64" >> $GITHUB_OUTPUT
76+
77+
- name: Extract version from tag
78+
id: version
79+
run: |
80+
# Remove 'v' prefix from tag (e.g., v1.0.0 -> 1.0.0)
81+
VERSION="${{ inputs.tag }}"
82+
VERSION="${VERSION#v}"
83+
echo "version=$VERSION" >> $GITHUB_OUTPUT
84+
85+
- name: Validate variables exist in scripts
86+
run: |
87+
set -euo pipefail
88+
89+
# Check checksum variables
90+
for var in LINUX_X86_64_CHECKSUM LINUX_ARM64_CHECKSUM MACOS_X86_64_CHECKSUM MACOS_ARM64_CHECKSUM; do
91+
grep -q "^${var}=" scripts/install.sh || { echo "ERROR: ${var} not found in install.sh"; exit 1; }
92+
done
93+
grep -q '^\$WINDOWS_X86_64_CHECKSUM' scripts/install.ps1 || { echo "ERROR: WINDOWS_X86_64_CHECKSUM not found in install.ps1"; exit 1; }
94+
95+
# Check version variables
96+
grep -q '^ASTRA_CLI_VERSION=' scripts/install.sh || { echo "ERROR: ASTRA_CLI_VERSION not found in install.sh"; exit 1; }
97+
grep -q '^\$ASTRA_CLI_VERSION' scripts/install.ps1 || { echo "ERROR: ASTRA_CLI_VERSION not found in install.ps1"; exit 1; }
98+
99+
- name: Update install.sh
100+
run: |
101+
set -euo pipefail
102+
103+
# Update checksums
104+
sed -i 's/^LINUX_X86_64_CHECKSUM=.*/LINUX_X86_64_CHECKSUM="${{ steps.checksums.outputs.linux_x86_64 }}"/' scripts/install.sh
105+
sed -i 's/^LINUX_ARM64_CHECKSUM=.*/LINUX_ARM64_CHECKSUM="${{ steps.checksums.outputs.linux_arm64 }}"/' scripts/install.sh
106+
sed -i 's/^MACOS_X86_64_CHECKSUM=.*/MACOS_X86_64_CHECKSUM="${{ steps.checksums.outputs.macos_x86_64 }}"/' scripts/install.sh
107+
sed -i 's/^MACOS_ARM64_CHECKSUM=.*/MACOS_ARM64_CHECKSUM="${{ steps.checksums.outputs.macos_arm64 }}"/' scripts/install.sh
108+
109+
# Update version
110+
sed -i 's/^ASTRA_CLI_VERSION=.*/ASTRA_CLI_VERSION="${{ steps.version.outputs.version }}"/' scripts/install.sh
111+
112+
- name: Update install.ps1
113+
run: |
114+
set -euo pipefail
115+
116+
# Update checksum
117+
sed -i 's/^\(\$WINDOWS_X86_64_CHECKSUM\s*=\s*\).*/\1"${{ steps.checksums.outputs.windows_x86_64 }}"/' scripts/install.ps1
118+
119+
# Update version
120+
sed -i 's/^\(\$ASTRA_CLI_VERSION\s*=\s*\).*/\1"${{ steps.version.outputs.version }}"/' scripts/install.ps1
121+
122+
- name: Create Pull Request
123+
uses: peter-evans/create-pull-request@v7
124+
with:
125+
branch: update-install-scripts-${{ github.run_id }}
126+
commit-message: "chore: update checksums and version for ${{ inputs.tag }}"
127+
title: "Update checksums and version for ${{ inputs.tag }}"
128+
body: |
129+
Automated update for release ${{ inputs.tag }}
130+
131+
**Changes:**
132+
- Updated version to ${{ steps.version.outputs.version }}
133+
- Updated checksums for all platforms
134+
labels: automated
135+
add-paths: |
136+
scripts/install.sh
137+
scripts/install.ps1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ bin/
5151
/*fake*
5252
/.env
5353
/.direnv
54+
/.bob

.idea/dictionaries/project.xml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 1 addition & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

astra-sdk-devops.jar

781 Bytes
Binary file not shown.

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ plugins {
1616
}
1717

1818
group = "com.dtsx.astra.cli"
19-
version = "1.0.1"
19+
version = "1.0.2"
2020

2121
val mockitoAgent = configurations.create("mockitoAgent")
2222

@@ -386,7 +386,7 @@ tasks.register<Jar>("fatJar") {
386386
dependsOn(configurations.runtimeClasspath)
387387
dependsOn("createDynamicProperties")
388388

389-
archiveFileName.set("fat.jar")
389+
archiveFileName.set("astra-fat.jar")
390390
archiveVersion.set(project.version.toString())
391391

392392
duplicatesStrategy = DuplicatesStrategy.EXCLUDE

0 commit comments

Comments
 (0)