Skip to content

Commit

Permalink
Merge pull request #171 from arduino/dependabot/github_actions/action…
Browse files Browse the repository at this point in the history
…s/upload-artifact-4

Bump actions/upload-artifact from 3 to 4
  • Loading branch information
per1234 authored Nov 7, 2024
2 parents 6ff43c4 + 3608ae2 commit 5444eb5
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 41 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
branches:
- main

env:
ARTIFACT_PREFIX: dist-

jobs:

build:
Expand All @@ -20,13 +23,16 @@ jobs:
strategy:
matrix:
config:
- os: ubuntu-latest
- artifact-suffix: Linux_64bit
os: ubuntu-latest
ExecutableSuffix: ''
Exports: ''
- os: macos-latest
- artifact-suffix: macOS_ARM64
os: macos-latest
ExecutableSuffix: ''
Exports: 'CGO_ENABLED=1 MACOSX_DEPLOYMENT_TARGET=10.14 '
- os: windows-2019
- artifact-suffix: Windows_64bit
os: windows-2019
ExecutableSuffix: '.exe'
Exports: ''
runs-on: ${{ matrix.config.os }}
Expand All @@ -48,9 +54,9 @@ jobs:
run: 7z a "${{ github.workspace }}/${{ env.BUILD_OUTPUT_DIRECTORY }}/archive/${{ env.EXECUTABLE_NAME }}_${{ runner.OS }}_amd64.zip" "${{ github.workspace }}/${{ env.BUILD_OUTPUT_DIRECTORY }}/${{ runner.OS }}_amd64/*"

- name: Upload Workflow Artifact [GitHub Actions]
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-artifacts
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.config.artifact-suffix }}
# this makes the artifact a .zip of the .zip archive, which is currently necessary to preserve the executable file permissions
# see: https://github.com/actions/upload-artifact/issues/38
path: ${{ env.BUILD_OUTPUT_DIRECTORY }}/archive/${{ env.EXECUTABLE_NAME }}_${{ runner.OS }}_amd64.zip
Expand All @@ -61,9 +67,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download Workflow Artifact [GitHub Actions]
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-artifacts
pattern: ${{ env.ARTIFACT_PREFIX }}*
merge-multiple: true
path: build-artifacts

- name: Publish Nightly [S3]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-go-dependencies-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
# Some might find it convenient to have CI generate the cache rather than setting up for it locally
- name: Upload cache to workflow artifact
if: failure() && steps.diff.outcome == 'failure'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
include-hidden-files: true
Expand Down
61 changes: 37 additions & 24 deletions .github/workflows/release-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
DIST_DIR: dist
# The project's folder on Arduino's download server for uploading builds
AWS_PLUGIN_TARGET: /arduino-language-server/
ARTIFACT_NAME: dist
ARTIFACT_PREFIX: dist-

on:
push:
Expand All @@ -21,16 +21,25 @@ jobs:

strategy:
matrix:
task:
- Windows_32bit
- Windows_64bit
- Linux_32bit
- Linux_64bit
- Linux_ARMv6
- Linux_ARMv7
- Linux_ARM64
- macOS_64bit
- macOS_ARM64
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
Expand All @@ -40,7 +49,7 @@ jobs:

- name: Create changelog
# Avoid creating the same changelog for each os
if: matrix.task == 'Windows_32bit'
if: matrix.os.task == 'Windows_32bit'
uses: arduino/create-changelog@v1
with:
tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+.*$'
Expand All @@ -55,13 +64,13 @@ jobs:
version: 3.x

- name: Build
run: task dist:${{ matrix.task }}
run: task dist:${{ matrix.os.task }}

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.os.artifact-suffix }}
path: ${{ env.DIST_DIR }}

notarize-macos:
Expand All @@ -78,9 +87,11 @@ jobs:
strategy:
matrix:
build:
- folder-suffix: darwin_amd64
- artifact-suffix: macOS_64bit
folder-suffix: darwin_amd64
package-suffix: "macOS_64bit.tar.gz"
- folder-suffix: darwin_arm64
- artifact-suffix: macOS_ARM64
folder-suffix: darwin_arm64
package-suffix: "macOS_ARM64.tar.gz"

steps:
Expand All @@ -95,9 +106,9 @@ jobs:
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.build.artifact-suffix }}
path: ${{ env.DIST_DIR }}

- name: Import Code-Signing Certificates
Expand Down Expand Up @@ -168,11 +179,12 @@ jobs:
-C "${{ env.BUILD_FOLDER }}/" "${{ env.PROJECT_NAME }}" \
-C ../../ LICENSE.txt
- name: Upload artifact
uses: actions/upload-artifact@v3
- name: Replace artifact with notarized build
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.build.artifact-suffix }}
overwrite: true
path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }}

create-release:
Expand All @@ -181,9 +193,10 @@ jobs:

steps:
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
pattern: ${{ env.ARTIFACT_PREFIX }}*
merge-multiple: true
path: ${{ env.DIST_DIR }}

- name: Create checksum file
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:

env:
CONFIGURATIONS_FOLDER: .github/label-configuration-files
CONFIGURATIONS_ARTIFACT: label-configuration-files
CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file-

jobs:
check:
Expand Down Expand Up @@ -71,13 +71,13 @@ jobs:
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}

- name: Pass configuration files to next job via workflow artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: |
*.yaml
*.yml
if-no-files-found: error
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}${{ matrix.filename }}

sync:
needs: download
Expand Down Expand Up @@ -108,16 +108,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download configuration files artifact
uses: actions/download-artifact@v3
- name: Download configuration file artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
merge-multiple: true
pattern: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}*
path: ${{ env.CONFIGURATIONS_FOLDER }}

- name: Remove unneeded artifact
uses: geekyeggo/delete-artifact@v2
- name: Remove unneeded artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}*

- name: Merge label configuration files
run: |
Expand Down

0 comments on commit 5444eb5

Please sign in to comment.