Skip to content

Upgrade go-serial library (fix high CPU load with some CH340 usb-2-se… #10

Upgrade go-serial library (fix high CPU load with some CH340 usb-2-se…

Upgrade go-serial library (fix high CPU load with some CH340 usb-2-se… #10

Workflow file for this run

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/release-go-task.md
name: Release
env:
# As defined by the Taskfile's PROJECT_NAME variable
PROJECT_NAME: serial-monitor
# As defined by the Taskfile's DIST_DIR variable
DIST_DIR: dist
# The project's folder on Arduino's download server for uploading builds
AWS_PLUGIN_TARGET: /monitor/serial-monitor/
AWS_REGION: "us-east-1"
ARTIFACT_PREFIX: dist-
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
jobs:
create-release-artifacts:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
os:
- task: Windows_32bit
artifact-suffix: Windows_32bit
- task: Windows_64bit
artifact-suffix: Windows_64bit
- task: Linux_32bit
artifact-suffix: Linux_32bit
- task: Linux_64bit
artifact-suffix: Linux_64bit
- task: Linux_ARMv6
artifact-suffix: Linux_ARMv6
- task: Linux_ARMv7
artifact-suffix: Linux_ARMv7
- task: Linux_ARM64
artifact-suffix: Linux_ARM64
- task: macOS_64bit
artifact-suffix: macOS_64bit
- task: macOS_ARM64
artifact-suffix: macOS_ARM64
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create changelog
# Avoid creating the same changelog for each os
if: matrix.os.task == 'Windows_32bit'
uses: arduino/create-changelog@v1
with:
tag-regex: '^v[0-9]+\.[0-9]+\.[0-9]+.*$'
filter-regex: '^\[(skip|changelog)[ ,-](skip|changelog)\].*'
case-insensitive-regex: true
changelog-file-path: "${{ env.DIST_DIR }}/CHANGELOG.md"
- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- name: Build
run: task dist:${{ matrix.os.task }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.os.artifact-suffix }}
path: ${{ env.DIST_DIR }}
create-release:
runs-on: ubuntu-latest
environment: production
needs: create-release-artifacts
permissions:
contents: write
id-token: write # This is required for requesting the JWT
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
pattern: ${{ env.ARTIFACT_PREFIX }}*
merge-multiple: true
path: ${{ env.DIST_DIR }}
- name: Create checksum file
working-directory: ${{ env.DIST_DIR}}
run: |
TAG="${GITHUB_REF/refs\/tags\//}"
sha256sum ${{ env.PROJECT_NAME }}_${TAG}* > ${TAG}-checksums.txt
- 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.2.0.zip
unzip -p /tmp/3.2.0.zip semver-tool-3.2.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
- name: Create Github Release and upload artifacts
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
bodyFile: ${{ env.DIST_DIR }}/CHANGELOG.md
draft: false
prerelease: ${{ steps.prerelease.outputs.IS_PRE }}
# NOTE: "Artifact is a directory" warnings are expected and don't indicate a problem
# (all the files we need are in the DIST_DIR root)
artifacts: ${{ env.DIST_DIR }}/*
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: "github_${{ env.PROJECT_NAME }}"
aws-region: ${{ env.AWS_REGION }}
- name: Upload release files on Arduino downloads servers
run: aws s3 sync ${{ env.DIST_DIR }} s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.AWS_PLUGIN_TARGET }}