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

Publish release on arduino download servers #570

Merged
merged 11 commits into from Nov 25, 2020
Merged

Conversation

@umbynos
Copy link
Collaborator

@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:
just like the arduino-cli does
@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
umbynos added 10 commits Nov 20, 2020
comment github release for testing purposes only
do not use drone.io docker container anymore, use aws cli instead (already installed on github runners)
This was failing because aws credentials are not suited for this bucket
Only temporarily (to make 1.1 release)
# 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
Comment on lines +189 to +198

This comment has been minimized.

@umbynos

umbynos Nov 25, 2020
Author Collaborator

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

# 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
Comment on lines +280 to +285

This comment has been minimized.

@umbynos

umbynos Nov 25, 2020
Author Collaborator

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

- 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
Comment on lines +357 to +364

This comment has been minimized.

@umbynos

umbynos Nov 25, 2020
Author Collaborator

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 "*"

This comment has been minimized.

@umbynos

umbynos Nov 25, 2020
Author Collaborator

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

@umbynos umbynos requested a review from zmoog Nov 25, 2020
@zmoog
zmoog approved these changes Nov 25, 2020
Copy link
Collaborator

@zmoog zmoog left a comment

LGTM!

@umbynos umbynos merged commit 1e420e1 into devel Nov 25, 2020
3 checks passed
3 checks passed
test-matrix (ubuntu-latest)
Details
test-matrix (windows-latest)
Details
test-matrix (macOS-latest)
Details
@umbynos umbynos deleted the umbynos/release_on_downloads branch Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.