Skip to content

Commit

Permalink
'task build' now uses a compliant semver notation
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Jul 18, 2024
1 parent 968689f commit 8d07cda
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-go-tester-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
uses: actions/download-artifact@v3
- name: Output checksum
run: |
TAG="${{ needs.package-name-prefix.outputs.prefix }}git-snapshot"
TAG="${{ needs.package-name-prefix.outputs.prefix }}1.0.0-snapshot"
declare -a artifacts=($(ls -d */))
for artifact in ${artifacts[@]}
do
Expand Down
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ vars:
sh: echo "{{now | date "20060102"}}"
TAG:
sh: echo "$(git tag --points-at=HEAD 2> /dev/null | head -n1 | sed 's/^v//')"
VERSION: "{{if .NIGHTLY}}nightly-{{.TIMESTAMP_SHORT}}{{else if .TAG}}{{.TAG}}{{else}}{{.PACKAGE_NAME_PREFIX}}git-snapshot{{end}}"
VERSION: "{{if .NIGHTLY}}nightly-{{.TIMESTAMP_SHORT}}{{else if .TAG}}{{.TAG}}{{else}}{{.PACKAGE_NAME_PREFIX}}1.0.0-snapshot{{end}}"
CONFIGURATION_PACKAGE: "github.com/arduino/arduino-cli/version"
LDFLAGS: >-
-ldflags
Expand Down
2 changes: 1 addition & 1 deletion commands/service_check_for_updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (s *arduinoCoreServerImpl) CheckForArduinoCLIUpdates(ctx context.Context, r
// shouldCheckForUpdate return true if it actually makes sense to check for new updates,
// false in all other cases.
func (s *arduinoCoreServerImpl) shouldCheckForUpdate(currentVersion *semver.Version) bool {
if strings.Contains(currentVersion.String(), "git-snapshot") || strings.Contains(currentVersion.String(), "nightly") {
if strings.Contains(currentVersion.String(), "1.0.0-snapshot") || strings.Contains(currentVersion.String(), "nightly") {
// This is a dev build, no need to check for updates
return false
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func runVersionCommand(ctx context.Context, srv rpc.ArduinoCoreServiceServer) {
logrus.Info("Executing `arduino-cli version`")

info := version.VersionInfo
if strings.Contains(info.VersionString, "git-snapshot") || strings.Contains(info.VersionString, "nightly") {
if strings.Contains(info.VersionString, "1.0.0-snapshot") || strings.Contains(info.VersionString, "nightly") {
// We're using a development version, no need to check if there's a
// new release available
feedback.PrintResult(info)
Expand Down
6 changes: 3 additions & 3 deletions internal/integrationtest/main/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ func TestVersion(t *testing.T) {
// Checks if Application's value is arduino-cli
require.Equal(t, jsonMap["Application"], "arduino-cli")

// Checks if VersionString's value is git-snapshot, nightly or a valid semantic versioning
// Checks if VersionString's value is 1.0.0-snapshot, nightly or a valid semantic versioning
switch version := jsonMap["VersionString"]; version {
case "git-snapshot":
require.Contains(t, version, "git-snapshot")
case "1.0.0-snapshot":
require.Contains(t, version, "1.0.0-snapshot")
case "nightly":
require.Contains(t, version, "nightly")
default:
Expand Down

0 comments on commit 8d07cda

Please sign in to comment.