Skip to content

Upload the signed bundle to s3 #756

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 3 commits into from
Jan 27, 2023
Merged
Changes from all commits
Commits
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
28 changes: 13 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
env:
# As defined by the Taskfile's PROJECT_NAME variable
PROJECT_NAME: arduino-create-agent
TARGET: "/CreateAgent/Stable"
TARGET: "/CreateAgent/Stable/"
OLD_TARGET: "/CreateBridge/" # compatibility with older releases (we can't change config.ini)
VERSION_TARGET: "arduino-create-static/agent-metadata/"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -26,6 +26,8 @@ env:
jobs:
# The build job is responsible for: configuring the environment, testing and compiling process
build:
outputs:
prerelease: ${{ steps.prerelease.outputs.IS_PRE }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-12]
Expand Down Expand Up @@ -204,13 +206,13 @@ jobs:
name: ArduinoCreateAgent.app
path: ArduinoCreateAgent.app.tar

# The notarize-macos job will download the macos bundle from the previous job, sign, notarize and re-upload it.
# The notarize-macos job will download the macos bundle from the previous job, sign, notarize and re-upload it, uploading it also on s3 download servers for the autoupdate.
notarize-macos:
name: Notarize bundle
runs-on: macos-12
env:
GON_PATH: ${{ github.workspace }}/gon
needs: create-macos-bundle
needs: [build, create-macos-bundle]

steps:
- name: Download artifact
Expand Down Expand Up @@ -276,6 +278,10 @@ jobs:
- name: Sign and notarize binary
run: gon -log-level=debug -log-json "${{ env.GON_CONFIG_PATH }}"

- name: Upload autoupdate bundle to Arduino downloads servers
run: aws s3 cp ArduinoCreateAgent.app_notarized.zip s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.TARGET }}${GITHUB_REF/refs\/tags\//}/ # the version should be created in th the build job
if: ${{ needs.build.outputs.prerelease }} != 'true'

- name: Upload artifact
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -493,7 +499,7 @@ jobs:

create-release:
runs-on: ubuntu-20.04
needs: code-sign-mac-installers
needs: [build, code-sign-mac-installers]

steps:
- name: Checkout
Expand All @@ -504,14 +510,6 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@v3 # download all the artifacts

- name: Identify Prerelease
# This is a workaround while waiting for create-release action to implement auto pre-release based on tag
id: prerelease
run: |
curl -L -s https://github.com/fsaintjacques/semver-tool/archive/3.1.0.zip -o /tmp/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 "IS_PRE=true" >> $GITHUB_OUTPUT; fi
# mandatory step because upload-release-action does not support multiple folders
- name: prepare artifacts for the release
run: |
Expand Down Expand Up @@ -562,7 +560,7 @@ jobs:
release_name: ${{ github.ref }}
body: ${{ steps.release_body.outputs.RBODY}}
draft: false
prerelease: ${{ steps.prerelease.outputs.IS_PRE }}
prerelease: ${{ needs.build.outputs.prerelease }}

- name: Upload release files on Github
uses: svenstaro/upload-release-action@v2
Expand All @@ -574,10 +572,10 @@ jobs:

- name: Upload release files on Arduino downloads servers
run: aws s3 sync release/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.TARGET }}
if: steps.prerelease.outputs.IS_PRE != 'true'
if: ${{ needs.build.outputs.prerelease }} != 'true'

- name: Update version file (used by frontend to trigger autoupdate and create filename)
run: |
echo {\"Version\": \"${GITHUB_REF##*/}\"} > /tmp/agent-version.json
aws s3 cp /tmp/agent-version.json s3://${{ env.VERSION_TARGET }}
if: steps.prerelease.outputs.IS_PRE != 'true'
if: ${{ needs.build.outputs.prerelease }} != 'true'