Skip to content

Commit

Permalink
update deprecated actions
Browse files Browse the repository at this point in the history
  • Loading branch information
umbynos committed Oct 9, 2024
1 parent 6774bfd commit 40e6414
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 39 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/check-markdown-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ on:
jobs:
run-determination:
runs-on: ubuntu-latest
permissions: {}
outputs:
result: ${{ steps.determination.outputs.result }}
steps:
Expand All @@ -60,27 +61,29 @@ jobs:
RESULT="false"
fi
echo "::set-output name=result::$RESULT"
echo "result=$RESULT" >> $GITHUB_OUTPUT
lint:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Initialize markdownlint-cli problem matcher
uses: xt0rted/markdownlint-problem-matcher@v1
uses: xt0rted/markdownlint-problem-matcher@v3

- name: Install Task
uses: arduino/setup-task@v1
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
Expand All @@ -92,21 +95,23 @@ jobs:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install Task
uses: arduino/setup-task@v1
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Check links
run: task --silent markdown:check-links
run: task --silent markdown:check-links
12 changes: 7 additions & 5 deletions .github/workflows/check-workflows-task.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/master/workflow-templates/check-workflows-task.md
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-workflows-task.md
name: Check Workflows

env:
Expand Down Expand Up @@ -28,21 +28,23 @@ on:
jobs:
validate:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install Task
uses: arduino/setup-task@v1
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Validate workflows
run: task --silent ci:validate
run: task --silent ci:validate
34 changes: 21 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
name: build (${{ matrix.config.os }}, ${{ matrix.config.arch }})
runs-on:
ubuntu-latest
permissions:
contents: read
strategy:
matrix:
config:
Expand Down Expand Up @@ -58,12 +60,12 @@ jobs:
# this repo should contain only the patches that could not be upstreamed and the release CI nothing else
- name: Checkout avrdude-packing repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: avrdude-packing

- name: Checkout avrdude repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: avrdudes/avrdude
ref: ${{ steps.get_tag_name.outputs.AVRDUDE_TAG }} # pay attention, the pathches could need updating
Expand Down Expand Up @@ -104,24 +106,26 @@ jobs:
tar -czv ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }} -f ${{ env.PROJECT_NAME }}_${GITHUB_REF##*/}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz
- 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_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}
path: ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}_*

notarize-macos:
runs-on: macos-latest
needs: build
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3
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_NAME }}_macOS_64bit
path: ${{ env.DIST_DIR }}

- name: Import Code-Signing Certificates
Expand Down Expand Up @@ -172,26 +176,30 @@ jobs:
-C ${{ env.DIST_DIR }}/ ${{ env.PROJECT_NAME }}_macOS_64bit/
- 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_NAME }}_macOS_64bit
path: ${{ env.DIST_DIR }}

overwrite: true

create-release:
runs-on:
ubuntu-latest
permissions:
contents: write
needs: [build, notarize-macos]

steps:
- name: Checkout repository # we need package_index.template
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: Identify Prerelease
# This is a workaround while waiting for create-release action
Expand Down
32 changes: 20 additions & 12 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ env:
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download JSON schema for labels configuration file
id: download-schema
uses: carlosperate/download-file-action@v1
uses: carlosperate/download-file-action@v2
with:
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json
location: ${{ runner.temp }}/label-configuration-schema
Expand All @@ -55,6 +57,7 @@ jobs:
download:
needs: check
runs-on: ubuntu-latest
permissions: {}

strategy:
matrix:
Expand All @@ -64,24 +67,28 @@ jobs:
- universal.yml
- tooling.yml


steps:
- name: Download
uses: carlosperate/download-file-action@v1
uses: carlosperate/download-file-action@v2
with:
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 }}-${{ matrix.filename }}

sync:
needs: download
runs-on: ubuntu-latest
permissions:
contents: read
issues: write

steps:
- name: Set environment variables
Expand All @@ -103,21 +110,22 @@ jobs:
run: |
# Use of this flag in the github-label-sync command will cause it to only check the validity of the
# configuration.
echo "::set-output name=flag::--dry-run"
echo "flag=--dry-run" >> $GITHUB_OUTPUT
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

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

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

- name: Merge label configuration files
run: |
Expand All @@ -136,4 +144,4 @@ jobs:
github-label-sync \
--labels "${{ env.MERGED_CONFIGURATION_PATH }}" \
${{ steps.dry-run.outputs.flag }} \
${{ github.repository }}
${{ github.repository }}

0 comments on commit 40e6414

Please sign in to comment.