Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check version bump when opening PRs #220

Merged
merged 45 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3f97f0b
WIP: Update README
micbakos-rdx Sep 20, 2024
7b8fe87
Update toolchain
micbakos-rdx Sep 20, 2024
4a9edec
Change script to use current host's toolchain
micbakos-rdx Sep 20, 2024
1b4c0b3
Make sargon desktop recognize host build target
micbakos-rdx Sep 20, 2024
9110077
Test build on ubuntu
micbakos-rdx Sep 20, 2024
fe71b17
Change machine to ubuntu-latest
micbakos-rdx Sep 20, 2024
c6974ff
Test assemble
micbakos-rdx Sep 20, 2024
d7cc985
Remove os matrix
micbakos-rdx Sep 20, 2024
f9d4fad
Produce buildCargo for debug and release. Allow skipping via property
micbakos-rdx Sep 20, 2024
17b25d4
Upload with the name of the binary
micbakos-rdx Sep 20, 2024
4131271
Put back java
micbakos-rdx Sep 20, 2024
2f58979
Add names to artifacts
micbakos-rdx Sep 20, 2024
34d25de
Add publish to desktop bins
micbakos-rdx Sep 20, 2024
156c6e9
Fix env
micbakos-rdx Sep 20, 2024
3c99d09
Add prerequisite to job
micbakos-rdx Sep 20, 2024
67ce2a8
Add env for github secret
micbakos-rdx Sep 20, 2024
96c8c4d
Put back custom build name
micbakos-rdx Sep 20, 2024
cf78409
Put -bins suffix back and fetch tags
micbakos-rdx Sep 20, 2024
f54f2ef
Make most test CI jobs run on ubuntu
micbakos-rdx Sep 23, 2024
e68aa89
Remove unnecessary jobs
micbakos-rdx Sep 23, 2024
f39126c
add rust components
micbakos-rdx Sep 23, 2024
9427d07
Change toolchain
micbakos-rdx Sep 23, 2024
d5966c0
Use older toolchain
micbakos-rdx Sep 23, 2024
e045f9d
Test release desktop
micbakos-rdx Sep 23, 2024
eeb8167
Make 2024-07-30 default
micbakos-rdx Sep 23, 2024
05f07b0
Make 2024-07-30 default on test
micbakos-rdx Sep 23, 2024
051835e
Change generate bindings task
micbakos-rdx Sep 23, 2024
1c105a5
WIP
micbakos-rdx Sep 23, 2024
a060b01
Changes to jvm modules
micbakos-rdx Sep 25, 2024
0c10277
Set jna.library.path
micbakos-rdx Sep 25, 2024
6178197
Uncomment jobs
micbakos-rdx Sep 25, 2024
785563f
Fix readme
micbakos-rdx Sep 25, 2024
c24599a
Fix formatting
micbakos-rdx Sep 25, 2024
b385dd2
check version bump on PRs
matiasbzurovski Sep 25, 2024
6799613
fix
matiasbzurovski Sep 25, 2024
2d11081
remove install of cargo-edit
matiasbzurovski Sep 25, 2024
73a4769
use regular checkout
matiasbzurovski Sep 25, 2024
7796192
Merge branch 'ci/ubuntu-runners' into ci/check-version-bump
matiasbzurovski Sep 25, 2024
e64c729
remove empty line
matiasbzurovski Sep 25, 2024
c77abb3
Merge branch 'main' into ci/check-version-bump
matiasbzurovski Sep 25, 2024
64cfa8c
bump to sync with releases
matiasbzurovski Sep 25, 2024
b33c956
update GH action
matiasbzurovski Sep 30, 2024
6eb57e7
merged main and bumped again
matiasbzurovski Sep 30, 2024
bcb96fd
delete space
matiasbzurovski Sep 30, 2024
aab740c
lowercase variable
matiasbzurovski Sep 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,57 @@ jobs:
- name: Check typos
run: typos

# version bump
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: RDXWorks-actions/checkout@main
with:
fetch-depth: 0 # Ensure the full git history is fetched

- name: Fetch all tags
run: git fetch --tags

- name: Get latest tag
id: get_latest_tag
run: |
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Latest tag is $latest_tag"
echo "latest_tag=$latest_tag" >> $GITHUB_ENV

- name: Verify Cargo.toml version bump
run: |
# Extract the version from the latest tag
latest_tag_version=$latest_tag

# Extract the version from Cargo.toml in the PR branch
pr_version=$(grep '^version' crates/sargon/Cargo.toml | sed 's/version = "\(.*\)"/\1/')

echo "Latest tag version: $latest_tag_version"
echo "PR version: $pr_version"

# Split the versions into major, minor, and patch components
IFS='.' read -r -a tag_version_parts <<< "$latest_tag_version"
IFS='.' read -r -a pr_version_parts <<< "$pr_version"

major_diff=$((pr_version_parts[0] - tag_version_parts[0]))
minor_diff=$((pr_version_parts[1] - tag_version_parts[1]))
patch_diff=$((pr_version_parts[2] - tag_version_parts[2]))

# Check if the PR version is a valid bump
if [ "$major_diff" -eq 1 ] && [ "${pr_version_parts[1]}" -eq 0 ] && [ "${pr_version_parts[2]}" -eq 0 ]; then
echo "Major version bump valid!"
elif [ "$major_diff" -eq 0 ] && [ "$minor_diff" -eq 1 ] && [ "${pr_version_parts[2]}" -eq 0 ]; then
echo "Minor version bump valid!"
elif [ "$major_diff" -eq 0 ] && [ "$minor_diff" -eq 0 ] && [ "$patch_diff" -eq 1 ]; then
echo "Patch version bump valid!"
else
echo "Version bump is invalid!"
exit 1
fi

# phylum
phylum-analyze:
if: ${{ github.event.pull_request }}
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/phylum-analyze.yml@main
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/sargon/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sargon"
version = "1.1.21"
version = "1.1.23"
edition = "2021"
build = "build.rs"

Expand Down
Loading