Unverified Commit 57bfabe6 authored by MatteoPologruto's avatar MatteoPologruto Committed by GitHub

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

* Update publish-go-tester-task

* Update publish-go-nightly-task

* Update release-go-task
parent c48844ba
...@@ -173,11 +173,11 @@ jobs: ...@@ -173,11 +173,11 @@ jobs:
name: ${{ env.ARTIFACT_NAME }} name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.DIST_DIR }} path: ${{ env.DIST_DIR }}
- name: Output checksum - name: Create checksum file
working-directory: ${{ env.DIST_DIR}} working-directory: ${{ env.DIST_DIR}}
run: | run: |
TAG="nightly-$(date -u +"%Y%m%d")" 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 - name: Upload release files on Arduino downloads servers
uses: docker://plugins/s3 uses: docker://plugins/s3
......
...@@ -28,7 +28,6 @@ env: ...@@ -28,7 +28,6 @@ env:
PROJECT_NAME: arduino-cli PROJECT_NAME: arduino-cli
# As defined by the Taskfile's DIST_DIR variable # As defined by the Taskfile's DIST_DIR variable
DIST_DIR: dist DIST_DIR: dist
BUILDS_ARTIFACT: build-artifacts
jobs: jobs:
run-determination: run-determination:
...@@ -54,40 +53,57 @@ jobs: ...@@ -54,40 +53,57 @@ jobs:
echo "::set-output name=result::$RESULT" echo "::set-output name=result::$RESULT"
build: package-name-prefix:
name: Build ${{ matrix.os.name }}
needs: run-determination needs: run-determination
if: needs.run-determination.outputs.result == 'true' if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest 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: strategy:
matrix: matrix:
os: os:
- dist: Windows_32bit - task: Windows_32bit
path: "*Windows_32bit.zip" path: "*Windows_32bit.zip"
name: Windows_X86-32 name: Windows_X86-32
- dist: Windows_64bit - task: Windows_64bit
path: "*Windows_64bit.zip" path: "*Windows_64bit.zip"
name: Windows_X86-64 name: Windows_X86-64
- dist: Linux_32bit - task: Linux_32bit
path: "*Linux_32bit.tar.gz" path: "*Linux_32bit.tar.gz"
name: Linux_X86-32 name: Linux_X86-32
- dist: Linux_64bit - task: Linux_64bit
path: "*Linux_64bit.tar.gz" path: "*Linux_64bit.tar.gz"
name: Linux_X86-64 name: Linux_X86-64
- dist: Linux_ARMv6 - task: Linux_ARMv6
path: "*Linux_ARMv6.tar.gz" path: "*Linux_ARMv6.tar.gz"
name: Linux_ARMv6 name: Linux_ARMv6
- dist: Linux_ARMv7 - task: Linux_ARMv7
path: "*Linux_ARMv7.tar.gz" path: "*Linux_ARMv7.tar.gz"
name: Linux_ARMv7 name: Linux_ARMv7
- dist: Linux_ARM64 - task: Linux_ARM64
path: "*Linux_ARM64.tar.gz" path: "*Linux_ARM64.tar.gz"
name: Linux_ARM64 name: Linux_ARM64
- dist: macOS_64bit - task: macOS_64bit
path: "*macOS_64bit.tar.gz" path: "*macOS_64bit.tar.gz"
name: macOS_64 name: macOS_64
- dist: macOS_ARM64 - task: macOS_ARM64
path: "*macOS_ARM64.tar.gz" path: "*macOS_ARM64.tar.gz"
name: macOS_ARM64 name: macOS_ARM64
...@@ -105,14 +121,11 @@ jobs: ...@@ -105,14 +121,11 @@ jobs:
- name: Build - name: Build
run: | run: |
PACKAGE_NAME_PREFIX="test" PACKAGE_NAME_PREFIX=${{ needs.package-name-prefix.outputs.prefix }}
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 }}-"
export PACKAGE_NAME_PREFIX export PACKAGE_NAME_PREFIX
task dist:${{ matrix.os.dist }} task dist:${{ matrix.os.task }}
# Transfer builds to artifacts job
- name: Upload build artifact - name: Upload build artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
...@@ -120,24 +133,18 @@ jobs: ...@@ -120,24 +133,18 @@ jobs:
name: ${{ matrix.os.name }} name: ${{ matrix.os.name }}
checksums: checksums:
needs: build needs:
- build
- package-name-prefix
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Download build artifacts - name: Download build artifacts
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with:
path: ${{ env.BUILDS_ARTIFACT }}
- name: Output checksum - name: Output checksum
working-directory: ${{ env.BUILDS_ARTIFACT}}
run: | run: |
PACKAGE_NAME_PREFIX="test" TAG="${{ needs.package-name-prefix.outputs.prefix }}git-snapshot"
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"
declare -a artifacts=($(ls -d */)) declare -a artifacts=($(ls -d */))
for artifact in ${artifacts[@]} for artifact in ${artifacts[@]}
do do
...@@ -150,5 +157,5 @@ jobs: ...@@ -150,5 +157,5 @@ jobs:
- name: Upload checksum artifact - name: Upload checksum artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
path: ${{ env.BUILDS_ARTIFACT }}/*checksums.txt path: ./*checksums.txt
name: checksums name: checksums
...@@ -180,11 +180,11 @@ jobs: ...@@ -180,11 +180,11 @@ jobs:
name: ${{ env.ARTIFACT_NAME }} name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.DIST_DIR }} path: ${{ env.DIST_DIR }}
- name: Output checksum - name: Create checksum file
working-directory: ${{ env.DIST_DIR}} working-directory: ${{ env.DIST_DIR}}
run: | run: |
TAG="${GITHUB_REF/refs\/tags\//}" TAG="${GITHUB_REF/refs\/tags\//}"
sha256sum ${{ env.PROJECT_NAME }}_${TAG}* >> ${TAG}-checksums.txt sha256sum ${{ env.PROJECT_NAME }}_${TAG}* > ${TAG}-checksums.txt
- name: Identify Prerelease - name: Identify Prerelease
# This is a workaround while waiting for create-release action # This is a workaround while waiting for create-release action
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment