[skip changelog] Update release process #1148
Conversation
container: | ||
image: arduino/arduino-cli:builder-1 | ||
volumes: | ||
# cache go dependencies across pipeline's steps | ||
- ${{ github.workspace }}/go:/go | ||
|
per1234
Jan 22, 2021
Contributor
I think this also needs to be done for the test
workflow:
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -107,10 +107,4 @@ jobs:
needs: test-matrix
- container:
- image: arduino/arduino-cli:builder-1
- volumes:
- # cache go dependencies across pipeline's steps
- - ${{ github.workspace }}/go:/go
-
steps:
- name: checkout
I think this also needs to be done for the test
workflow:
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -107,10 +107,4 @@ jobs:
needs: test-matrix
- container:
- image: arduino/arduino-cli:builder-1
- volumes:
- # cache go dependencies across pipeline's steps
- - ${{ github.workspace }}/go:/go
-
steps:
- name: checkout
silvanocerza
Jan 22, 2021
Author
Contributor
Yep, nice catch! Totally forgot about it.
Yep, nice catch! Totally forgot about it.
sha256sum {{ .PACKAGE_NAME }} >> {{ .CHECKSUM_FILE }} | ||
vars: | ||
PLATFORM_DIR: "{{ .PROJECT_NAME }}_osx_darwin_amd64" |
per1234
Jan 22, 2021
Contributor
For some reason, the previous build process named this directory arduino_cli_osx_darwin_amd64
(note the underscore in arduino_cli
). This PR sets the PROJECT_NAME
variable to the correct arduino-cli
(note the hyphen), but the macOS notarization system still expects the old folder name. So it must be updated accordingly:
diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml
index d944adc1..6d3bef35 100644
--- a/.github/workflows/nightly.yaml
+++ b/.github/workflows/nightly.yaml
@@ -85,6 +85,6 @@ jobs:
# so we need to add execution permission back until @v2 actions are released.
- chmod +x dist/arduino_cli_osx_darwin_amd64/arduino-cli
+ chmod +x dist/arduino-cli_osx_darwin_amd64/arduino-cli
PACKAGE_FILENAME="$(basename dist/arduino-cli_${{ github.workflow }}-*_macOS_64bit.tar.gz)"
tar -czvf dist/$PACKAGE_FILENAME \
- -C dist/arduino_cli_osx_darwin_amd64/ arduino-cli \
+ -C dist/arduino-cli_osx_darwin_amd64/ arduino-cli \
-C ../../ LICENSE.txt
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index fbbb8454..614567d9 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -87,6 +87,6 @@ jobs:
# so we need to add execution permission back until @v2 actions are released.
- chmod +x dist/arduino_cli_osx_darwin_amd64/arduino-cli
+ chmod +x dist/arduino-cli_osx_darwin_amd64/arduino-cli
TAG=${GITHUB_REF/refs\/tags\//}
tar -czvf dist/arduino-cli_${TAG}_macOS_64bit.tar.gz \
- -C dist/arduino_cli_osx_darwin_amd64/ arduino-cli \
+ -C dist/arduino-cli_osx_darwin_amd64/ arduino-cli \
-C ../../ LICENSE.txt
diff --git a/gon.config.hcl b/gon.config.hcl
index 9de9a781..dc9d8d50 100644
--- a/gon.config.hcl
+++ b/gon.config.hcl
@@ -1,2 +1,2 @@
-source = ["dist/arduino_cli_osx_darwin_amd64/arduino-cli"]
+source = ["dist/arduino-cli_osx_darwin_amd64/arduino-cli"]
bundle_id = "cc.arduino.arduino-cli"
For some reason, the previous build process named this directory arduino_cli_osx_darwin_amd64
(note the underscore in arduino_cli
). This PR sets the PROJECT_NAME
variable to the correct arduino-cli
(note the hyphen), but the macOS notarization system still expects the old folder name. So it must be updated accordingly:
diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml
index d944adc1..6d3bef35 100644
--- a/.github/workflows/nightly.yaml
+++ b/.github/workflows/nightly.yaml
@@ -85,6 +85,6 @@ jobs:
# so we need to add execution permission back until @v2 actions are released.
- chmod +x dist/arduino_cli_osx_darwin_amd64/arduino-cli
+ chmod +x dist/arduino-cli_osx_darwin_amd64/arduino-cli
PACKAGE_FILENAME="$(basename dist/arduino-cli_${{ github.workflow }}-*_macOS_64bit.tar.gz)"
tar -czvf dist/$PACKAGE_FILENAME \
- -C dist/arduino_cli_osx_darwin_amd64/ arduino-cli \
+ -C dist/arduino-cli_osx_darwin_amd64/ arduino-cli \
-C ../../ LICENSE.txt
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index fbbb8454..614567d9 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -87,6 +87,6 @@ jobs:
# so we need to add execution permission back until @v2 actions are released.
- chmod +x dist/arduino_cli_osx_darwin_amd64/arduino-cli
+ chmod +x dist/arduino-cli_osx_darwin_amd64/arduino-cli
TAG=${GITHUB_REF/refs\/tags\//}
tar -czvf dist/arduino-cli_${TAG}_macOS_64bit.tar.gz \
- -C dist/arduino_cli_osx_darwin_amd64/ arduino-cli \
+ -C dist/arduino-cli_osx_darwin_amd64/ arduino-cli \
-C ../../ LICENSE.txt
diff --git a/gon.config.hcl b/gon.config.hcl
index 9de9a781..dc9d8d50 100644
--- a/gon.config.hcl
+++ b/gon.config.hcl
@@ -1,2 +1,2 @@
-source = ["dist/arduino_cli_osx_darwin_amd64/arduino-cli"]
+source = ["dist/arduino-cli_osx_darwin_amd64/arduino-cli"]
bundle_id = "cc.arduino.arduino-cli"
if [ "${{ github.event_name }}" = "pull_request" ]; then | ||
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}" | ||
fi | ||
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}" | ||
export PACKAGE_NAME_PREFIX |
per1234
Jan 22, 2021
Contributor
It's unfortunate to lose this. In my version of the release system, I had this in mind when I set it up so a custom version could be specified via an environment variable:
- https://github.com/arduino/arduino-lint/blob/7af3d443215c8b3e08614aadf60df666f6a1f31b/DistTasks.yml#L197
- https://github.com/arduino/arduino-lint/blob/7af3d443215c8b3e08614aadf60df666f6a1f31b/.github/workflows/nightly.yml#L27
Any chance we could do something like that?
It's unfortunate to lose this. In my version of the release system, I had this in mind when I set it up so a custom version could be specified via an environment variable:
- https://github.com/arduino/arduino-lint/blob/7af3d443215c8b3e08614aadf60df666f6a1f31b/DistTasks.yml#L197
- https://github.com/arduino/arduino-lint/blob/7af3d443215c8b3e08614aadf60df666f6a1f31b/.github/workflows/nightly.yml#L27
Any chance we could do something like that?
silvanocerza
Jan 22, 2021
Author
Contributor
What do you think of something like this?
diff --git a/Taskfile.yml b/Taskfile.yml
index a2c4f605..8f4d5faa 100755
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -213,7 +213,7 @@ vars:
sh: echo "{{now | date "20060102"}}"
TAG:
sh: echo "`git tag --points-at=HEAD 2> /dev/null`"
- VERSION: "{{ if .NIGHTLY }}nightly-{{ .TIMESTAMP_SHORT }}{{ else if .TAG }}{{ .TAG }}{{ else }}snapshot{{ end }}"
+ VERSION: "{{ if .NIGHTLY }}nightly-{{ .TIMESTAMP_SHORT }}{{ else if .TAG }}{{ .TAG }}{{ else }}{{ .PACKAGE_NAME_PREFIX }}snapshot{{ end }}"
LDFLAGS: >
-ldflags
'
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 3c81dcf2..e1e1aef5 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -125,7 +119,14 @@ jobs:
version: 3.x
- name: Build
- run: task dist:all
+ run: |
+ PACKAGE_NAME_PREFIX="${{ github.workflow }}-"
+ if [ "${{ github.event_name }}" = "pull_request" ]; then
+ PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}-"
+ fi
+ PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-"
+ export PACKAGE_NAME_PREFIX
+ task dist:all
# Uploads all architectures as separate artifacts
- name: Upload Linux 32 bit artifact
I remember removing this because it was kind of a pain to test but thinking about it I just have to change the test like this:
diff --git a/test/test_main.py b/test/test_main.py
index e9c1a092..6f171fa5 100644
--- a/test/test_main.py
+++ b/test/test_main.py
@@ -38,7 +38,7 @@ def test_version(run_command):
parsed_out = json.loads(result.stdout)
assert parsed_out.get("Application", False) == "arduino-cli"
version = parsed_out.get("VersionString", False)
- assert semver.VersionInfo.isvalid(version=version) or version == "snapshot" or "nightly" in version
+ assert semver.VersionInfo.isvalid(version=version) or "snapshot" in version or "nightly" in version
assert isinstance(parsed_out.get("Commit", False), str)
What do you think of something like this?
diff --git a/Taskfile.yml b/Taskfile.yml
index a2c4f605..8f4d5faa 100755
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -213,7 +213,7 @@ vars:
sh: echo "{{now | date "20060102"}}"
TAG:
sh: echo "`git tag --points-at=HEAD 2> /dev/null`"
- VERSION: "{{ if .NIGHTLY }}nightly-{{ .TIMESTAMP_SHORT }}{{ else if .TAG }}{{ .TAG }}{{ else }}snapshot{{ end }}"
+ VERSION: "{{ if .NIGHTLY }}nightly-{{ .TIMESTAMP_SHORT }}{{ else if .TAG }}{{ .TAG }}{{ else }}{{ .PACKAGE_NAME_PREFIX }}snapshot{{ end }}"
LDFLAGS: >
-ldflags
'
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 3c81dcf2..e1e1aef5 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -125,7 +119,14 @@ jobs:
version: 3.x
- name: Build
- run: task dist:all
+ run: |
+ PACKAGE_NAME_PREFIX="${{ github.workflow }}-"
+ if [ "${{ github.event_name }}" = "pull_request" ]; then
+ PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}-"
+ fi
+ PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-"
+ export PACKAGE_NAME_PREFIX
+ task dist:all
# Uploads all architectures as separate artifacts
- name: Upload Linux 32 bit artifact
I remember removing this because it was kind of a pain to test but thinking about it I just have to change the test like this:
diff --git a/test/test_main.py b/test/test_main.py
index e9c1a092..6f171fa5 100644
--- a/test/test_main.py
+++ b/test/test_main.py
@@ -38,7 +38,7 @@ def test_version(run_command):
parsed_out = json.loads(result.stdout)
assert parsed_out.get("Application", False) == "arduino-cli"
version = parsed_out.get("VersionString", False)
- assert semver.VersionInfo.isvalid(version=version) or version == "snapshot" or "nightly" in version
+ assert semver.VersionInfo.isvalid(version=version) or "snapshot" in version or "nightly" in version
assert isinstance(parsed_out.get("Commit", False), str)
per1234
Jan 22, 2021
Contributor
Looks good!
Looks good!
I just pushed another commit that changes the This is the snippet in question, it panics at line 69 since the arduino-cli/cli/lib/install.go Lines 64 to 75 in 7e55f9e |
PACKAGE_NAME_PREFIX="${{ github.workflow }}-" | ||
if [ "${{ github.event_name }}" = "pull_request" ]; then | ||
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}" | ||
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}-" |
per1234
Jan 22, 2021
Contributor
The -
appended here are redundant. Note the double --
here:
https://github.com/arduino/arduino-cli/pull/1148/checks?check_run_id=1748258721#step:4:91
--build-cmd "go build -o dist/arduino-cli_windows_386/arduino-cli.exe -ldflags ' -X github.com/arduino/arduino-cli/version.versionString=test--1148--6a52a9a31b2b71bf80f20fa03205143adf07d4cf-git-snapshot -X github.com/arduino/arduino-cli/version.commit=e975be30 -X github.com/arduino/arduino-cli/version.date=2021-01-22T11:14:28Z '
$ ./arduino-cli version
arduino-cli.exe alpha Version: test--1148--6a52a9a31b2b71bf80f20fa03205143adf07d4cf-git-snapshot Commit: e975be30 Date: 2021-01-22T11:14:28Z
The -
appended here are redundant. Note the double --
here:
https://github.com/arduino/arduino-cli/pull/1148/checks?check_run_id=1748258721#step:4:91
--build-cmd "go build -o dist/arduino-cli_windows_386/arduino-cli.exe -ldflags ' -X github.com/arduino/arduino-cli/version.versionString=test--1148--6a52a9a31b2b71bf80f20fa03205143adf07d4cf-git-snapshot -X github.com/arduino/arduino-cli/version.commit=e975be30 -X github.com/arduino/arduino-cli/version.date=2021-01-22T11:14:28Z '
$ ./arduino-cli version
arduino-cli.exe alpha Version: test--1148--6a52a9a31b2b71bf80f20fa03205143adf07d4cf-git-snapshot Commit: e975be30 Date: 2021-01-22T11:14:28Z
silvanocerza
Jan 22, 2021
Author
Contributor
Right, I'll remove it.
Right, I'll remove it.
Great work Silvano! Very exciting to have a new build system in place. I ran the "nightly" and "release" workflows in my fork with my Apple signing certificate and verified that the macOS signing/notarization system is all working fine. |
* [skip changelog] Ditch goreleaser in favor of a new release process * [skip changelog] Fix version output test * [skip changelog] Fix some workflows issues * [skip changelog] Fix panic when running integration tests * [skip changelog] Remove extra chars from package name prefix
Please check if the PR fulfills these requirements
before creating one)
UPGRADING.md
has been updated with a migration guide (for breaking changes)Updates the process used to create new builds and releases.
We currently use goreleaser to create changelogs and new releases.
We ditch goreleaser, we use Task and different Docker containers to create dist files for different platforms.
Nope.
None.
See how to contribute