Skip to content

[skip-changelog] Update release workflows to match their templates #1922

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
Oct 14, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/publish-go-nightly-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ jobs:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.DIST_DIR }}

- name: Output checksum
- name: Create checksum file
working-directory: ${{ env.DIST_DIR}}
run: |
TAG="nightly-$(date -u +"%Y%m%d")"
sha256sum ${{ env.PROJECT_NAME }}_${TAG}* >> ${TAG}-checksums.txt
sha256sum ${{ env.PROJECT_NAME }}_${TAG}* > ${TAG}-checksums.txt

- name: Upload release files on Arduino downloads servers
uses: docker://plugins/s3
Expand Down
65 changes: 36 additions & 29 deletions .github/workflows/publish-go-tester-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ env:
PROJECT_NAME: arduino-cli
# As defined by the Taskfile's DIST_DIR variable
DIST_DIR: dist
BUILDS_ARTIFACT: build-artifacts

jobs:
run-determination:
Expand All @@ -54,40 +53,57 @@ jobs:

echo "::set-output name=result::$RESULT"

build:
name: Build ${{ matrix.os.name }}
package-name-prefix:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
outputs:
prefix: ${{ steps.calculation.outputs.prefix }}
steps:
- name: package name prefix calculation
id: calculation
run: |
PACKAGE_NAME_PREFIX="test"
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 }}-"

echo "::set-output name=prefix::$PACKAGE_NAME_PREFIX"

build:
needs: package-name-prefix
name: Build ${{ matrix.os.name }}
runs-on: ubuntu-latest

strategy:
matrix:
os:
- dist: Windows_32bit
- task: Windows_32bit
path: "*Windows_32bit.zip"
name: Windows_X86-32
- dist: Windows_64bit
- task: Windows_64bit
path: "*Windows_64bit.zip"
name: Windows_X86-64
- dist: Linux_32bit
- task: Linux_32bit
path: "*Linux_32bit.tar.gz"
name: Linux_X86-32
- dist: Linux_64bit
- task: Linux_64bit
path: "*Linux_64bit.tar.gz"
name: Linux_X86-64
- dist: Linux_ARMv6
- task: Linux_ARMv6
path: "*Linux_ARMv6.tar.gz"
name: Linux_ARMv6
- dist: Linux_ARMv7
- task: Linux_ARMv7
path: "*Linux_ARMv7.tar.gz"
name: Linux_ARMv7
- dist: Linux_ARM64
- task: Linux_ARM64
path: "*Linux_ARM64.tar.gz"
name: Linux_ARM64
- dist: macOS_64bit
- task: macOS_64bit
path: "*macOS_64bit.tar.gz"
name: macOS_64
- dist: macOS_ARM64
- task: macOS_ARM64
path: "*macOS_ARM64.tar.gz"
name: macOS_ARM64

Expand All @@ -105,39 +121,30 @@ jobs:

- name: Build
run: |
PACKAGE_NAME_PREFIX="test"
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 }}-"
PACKAGE_NAME_PREFIX=${{ needs.package-name-prefix.outputs.prefix }}
export PACKAGE_NAME_PREFIX
task dist:${{ matrix.os.dist }}
task dist:${{ matrix.os.task }}

# Transfer builds to artifacts job
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
path: ${{ env.DIST_DIR }}/${{ matrix.os.path }}
name: ${{ matrix.os.name }}

checksums:
needs: build
needs:
- build
- package-name-prefix
runs-on: ubuntu-latest

steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
path: ${{ env.BUILDS_ARTIFACT }}

- name: Output checksum
working-directory: ${{ env.BUILDS_ARTIFACT}}
run: |
PACKAGE_NAME_PREFIX="test"
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 }}-"
TAG="${PACKAGE_NAME_PREFIX}git-snapshot"
TAG="${{ needs.package-name-prefix.outputs.prefix }}git-snapshot"
declare -a artifacts=($(ls -d */))
for artifact in ${artifacts[@]}
do
Expand All @@ -150,5 +157,5 @@ jobs:
- name: Upload checksum artifact
uses: actions/upload-artifact@v3
with:
path: ${{ env.BUILDS_ARTIFACT }}/*checksums.txt
path: ./*checksums.txt
name: checksums
4 changes: 2 additions & 2 deletions .github/workflows/release-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ jobs:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.DIST_DIR }}

- name: Output checksum
- name: Create checksum file
working-directory: ${{ env.DIST_DIR}}
run: |
TAG="${GITHUB_REF/refs\/tags\//}"
sha256sum ${{ env.PROJECT_NAME }}_${TAG}* >> ${TAG}-checksums.txt
sha256sum ${{ env.PROJECT_NAME }}_${TAG}* > ${TAG}-checksums.txt
- name: Identify Prerelease
# This is a workaround while waiting for create-release action
Expand Down