Skip to content

Publish release on arduino download servers #570

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

Merged
merged 11 commits into from
Nov 25, 2020

Conversation

umbynos
Copy link
Contributor

@umbynos umbynos commented Nov 19, 2020

just like the arduino-cli does

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • Tests for the changes have been added (for bug fixes / features)
  • What kind of change does this PR introduce?

feature

  • What is the current behavior?
  • What is the new behavior?

Add steps to the release.yml workflow:

  1. to detect if a release is a prerelease or not ❓
  2. to publish release installers to arduino servers automatically (in case of a full release) 🔽
  • Does this PR introduce a breaking change?

nope

  • Other information:

@umbynos umbynos changed the title add workaround step to check semver and trigger prerelease Publish release on arduino download servers Nov 19, 2020
@umbynos umbynos self-assigned this Nov 19, 2020
@umbynos umbynos added the CI label Nov 19, 2020
Comment on lines +189 to +198
# workaround to strip bugfix number from semver (only to make 1.1 release) I will change this in the future
- name: Set version env vars
# VERSION will be available only in the next step
run: |
echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Set installer env vars
run: |
echo INSTALLER_VARS="project.outputDirectory=$PWD project.version=${VERSION%.*} workspace=$PWD realname=Arduino_Create_Bridge" >> $GITHUB_ENV

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of this workaround is to consider only major.minor in the string used in the name of the installer. Without this and by using only GITHUB_REF##*/ the result will be something like 1.1.251 instead of the desired 1.1

The >> $GITHUB_ENV trick is used because in not possible to use an env variable defined inside env inside the same environment

Comment on lines +280 to +285
# workaround to strip bugfix number from semver (only to make 1.1 release) I will change this in the future
- name: Set version env vars
# VERSION will be available only in the next step
run: |
echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately the trick of using $GITHUB_ENV do not work between different jobs

Comment on lines +357 to +364
- name: Identify Prerelease
# This is a workaround while waiting for create-release action to implement auto pre-release based on tag
id: prerelease
run: |
wget -q -P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.1.0.zip
unzip -p /tmp/3.1.0.zip semver-tool-3.1.0/src/semver >/tmp/semver && chmod +x /tmp/semver
if [[ $(/tmp/semver get prerel ${GITHUB_REF/refs\/tags\//}) ]]; then echo "::set-output name=IS_PRE::true"; fi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just like in the arduino-cli this step is useful to check if a release is actually a prerelease based on the tag (1.2.0-dev and 1.2.0-rc1 are both considered prereleases)

@@ -361,3 +390,7 @@ jobs:
tag: ${{ github.ref }}
file_glob: true # If set to true, the file argument can be a glob pattern
file: release/*

- name: Upload release files on Arduino downloads servers
run: aws s3 sync release/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.PLUGIN_TARGET }} --include "*"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The files are uploaded to https://downloads.arduino.cc/tmp/CreateBridgeStable/<filename>

@umbynos umbynos requested a review from zmoog November 25, 2020 14:11
Copy link
Contributor

@zmoog zmoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@umbynos umbynos merged commit 1e420e1 into devel Nov 25, 2020
@umbynos umbynos deleted the umbynos/release_on_downloads branch November 25, 2020 14:34
@per1234 per1234 added the topic: infrastructure Related to project infrastructure label Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants