Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into PP-371-Prevent-wrong-…
Browse files Browse the repository at this point in the history
…temperature-with-support-materials
  • Loading branch information
wawanbreton committed Jul 2, 2024
2 parents 03c5ecc + f7a3b48 commit 2e0bc8c
Show file tree
Hide file tree
Showing 119 changed files with 982 additions and 12,881 deletions.
43 changes: 33 additions & 10 deletions .github/workflows/installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,29 @@ on:
required: true
type: boolean

workflow_call:
inputs:
cura_conan_version:
default: 'cura/latest@ultimaker/testing'
required: true
type: string
conan_args:
default: ''
required: false
type: string
enterprise:
default: false
required: true
type: boolean
staging:
default: false
required: true
type: boolean
nightly:
default: false
required: true
type: boolean

schedule:
# Daily at 4:15 CET (main-branch) and 5:15 CET (release-branch)
- cron: '15 3 * * *'
Expand Down Expand Up @@ -70,7 +93,7 @@ jobs:
enterprise: ${{ github.event.inputs.enterprise == 'true' }}
staging: ${{ github.event.inputs.staging == 'true' }}
architecture: X64
operating_system: ubuntu-22.04
operating_system: self-hosted-Ubuntu22-X64
secrets: inherit

macos-installer:
Expand Down Expand Up @@ -109,7 +132,7 @@ jobs:
fetch-depth: 1

- name: Download the run info
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: linux-run-info

Expand Down Expand Up @@ -151,13 +174,13 @@ jobs:
f.writelines(f"NIGHTLY_TIME={nightly_creation_time}\n")
- name: Download linux installer jobs artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ steps.filename.outputs.LINUX }}-AppImage
path: installers

- name: Download linux installer jobs asc artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ steps.filename.outputs.LINUX }}-asc
path: installers
Expand All @@ -175,13 +198,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Download win msi installer jobs artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ steps.filename.outputs.WIN_MSI }}-msi
path: installers

- name: Download win exe installer jobs artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ steps.filename.outputs.WIN_EXE }}-exe
path: installers
Expand All @@ -199,13 +222,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Download MacOS (X64) dmg installer jobs artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ steps.filename.outputs.MAC_X64_DMG }}-dmg
path: installers

- name: Download MacOS (X64) pkg installer jobs artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ steps.filename.outputs.MAC_X64_PKG }}-pkg
path: installers
Expand All @@ -223,13 +246,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Download MacOS (ARM-64) dmg installer jobs artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ steps.filename.outputs.MAC_ARM_DMG }}-dmg
path: installers

- name: Download MacOS (ARM-64) pkg installer jobs artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ steps.filename.outputs.MAC_ARM_PKG }}-pkg
path: installers
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ on:
operating_system:
description: 'OS'
required: true
default: 'ubuntu-22.04'
default: 'self-hosted-Ubuntu22-X64'
type: choice
options:
- ubuntu-22.04
- self-hosted-Ubuntu22-X64

jobs:
linux-installer:
Expand All @@ -49,4 +50,4 @@ jobs:
staging: ${{ inputs.staging }}
architecture: ${{ inputs.architecture }}
operating_system: ${{ inputs.operating_system }}
secrets: inherit
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ on:
options:
- self-hosted-X64
- self-hosted-ARM64
- macos-11
- macos-12

jobs:
Expand All @@ -53,4 +52,4 @@ jobs:
staging: ${{ inputs.staging }}
architecture: ${{ inputs.architecture }}
operating_system: ${{ inputs.operating_system }}
secrets: inherit
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/printer-linter-pr-diagnose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
run: |
echo ${{ github.event.number }} > printer-linter-result/pr-id.txt
echo ${{ github.event.pull_request.head.repo.full_name }} > printer-linter-result/pr-head-repo.txt
echo ${{ github.event.pull_request.head.ref }} > printer-linter-result/pr-head-ref.txt
echo ${{ github.event.pull_request.head.sha }} > printer-linter-result/pr-head-sha.txt
- uses: actions/upload-artifact@v2
with:
Expand Down
81 changes: 48 additions & 33 deletions .github/workflows/printer-linter-pr-post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,92 +5,107 @@ on:
workflows: ["printer-linter-pr-diagnose"]
types: [completed]

permissions:
issues: write

jobs:
clang-tidy-results:
printer-linter-result:
# Trigger the job only if the previous (insecure) workflow completed successfully
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Download analysis results
uses: actions/github-script@v3.1.0
uses: actions/github-script@v7
with:
script: |
let artifacts = await github.actions.listWorkflowRunArtifacts({
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
let matchArtifact = artifacts.data.artifacts.filter((artifact) => {
const matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "printer-linter-result"
})[0];
let download = await github.actions.downloadArtifact({
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: "zip",
});
let fs = require("fs");
fs.writeFileSync("${{github.workspace}}/printer-linter-result.zip", Buffer.from(download.data));
const fs = require("fs");
fs.writeFileSync("${{ github.workspace }}/printer-linter-result.zip", Buffer.from(download.data));
- name: Set environment variables
- name: Extract analysis results
run: |
mkdir printer-linter-result
unzip printer-linter-result.zip -d printer-linter-result
echo "pr_id=$(cat printer-linter-result/pr-id.txt)" >> $GITHUB_ENV
echo "pr_head_repo=$(cat printer-linter-result/pr-head-repo.txt)" >> $GITHUB_ENV
echo "pr_head_ref=$(cat printer-linter-result/pr-head-ref.txt)" >> $GITHUB_ENV
if [[ -f "printer-linter-result/comment.md" ]]; then
echo "commentFileExists=true" >> $GITHUB_ENV
else
echo "commentFileExists=false" >> $GITHUB_ENV
fi
unzip -j printer-linter-result.zip -d printer-linter-result
- name: Set PR details environment variables
uses: actions/github-script@v7
with:
script: |
const assert = require("node:assert").strict;
const fs = require("fs");
function exportVar(varName, fileName, regEx) {
const val = fs.readFileSync("${{ github.workspace }}/printer-linter-result/" + fileName, {
encoding: "ascii"
}).trimEnd();
assert.ok(regEx.test(val), "Invalid value format for " + varName);
core.exportVariable(varName, val);
}
exportVar("PR_ID", "pr-id.txt", /^[0-9]+$/);
exportVar("PR_HEAD_REPO", "pr-head-repo.txt", /^[-./0-9A-Z_a-z]+$/);
exportVar("PR_HEAD_SHA", "pr-head-sha.txt", /^[0-9A-Fa-f]+$/);
fs.access("${{ github.workspace }}/printer-linter-result/comment.md", fs.constants.F_OK, (err) => {
if (err) {
core.exportVariable("commentFileExists", "false");
} else {
core.exportVariable("commentFileExists", "true");
}
});
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: ${{ env.pr_head_repo }}
ref: ${{ env.pr_head_ref }}
repository: ${{ env.PR_HEAD_REPO }}
ref: ${{ env.PR_HEAD_SHA }}
persist-credentials: false

- name: Redownload analysis results
uses: actions/github-script@v3.1.0
uses: actions/github-script@v7
with:
script: |
let artifacts = await github.actions.listWorkflowRunArtifacts({
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
let matchArtifact = artifacts.data.artifacts.filter((artifact) => {
const matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "printer-linter-result"
})[0];
let download = await github.actions.downloadArtifact({
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: "zip",
});
let fs = require("fs");
fs.writeFileSync("${{github.workspace}}/printer-linter-result.zip", Buffer.from(download.data));
const fs = require("fs");
fs.writeFileSync("${{ github.workspace }}/printer-linter-result.zip", Buffer.from(download.data));
- name: Extract analysis results
run: |
mkdir printer-linter-result
unzip printer-linter-result.zip -d printer-linter-result
unzip -j printer-linter-result.zip -d printer-linter-result
- name: Run PR Comments
if: env.commentFileExists == 'true'
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ env.pr_id }}
issue-number: ${{ env.PR_ID }}
body-path: 'printer-linter-result/comment.md'

- name: Run clang-tidy-pr-comments action
uses: platisd/clang-tidy-pr-comments@bc0bb7da034a8317d54e7fe1e819159002f4cc40
uses: platisd/clang-tidy-pr-comments@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clang_tidy_fixes: printer-linter-result/fixes.yml
pull_request_id: ${{ env.pr_id }}
pull_request_id: ${{ env.PR_ID }}
request_changes: true
32 changes: 32 additions & 0 deletions .github/workflows/release-process_feature-freeze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Feature Freeze
run-name: Feature freeze Cura ${{ inputs.cura_version }} by @${{ github.actor }}

on:
workflow_dispatch:
inputs:
cura_version:
description: 'Cura version major and minor, e.g. 5.7'
required: true
type: string

jobs:
parse-version:
name: Parse input version string
runs-on: ubuntu-latest
outputs:
package_version: ${{ steps.version_parser.outputs.major }}.${{ steps.version_parser.outputs.minor }}.0-alpha.1
steps:
- name: Parse version string
id: version_parser
uses: booxmedialtd/[email protected]
with:
input_string: ${{ inputs.cura_version }}.0

feature-freeze:
name: Process feature freeze
uses: Ultimaker/Cura-workflows/.github/workflows/cura-set-packages-versions.yml@main
needs: [parse-version]
with:
cura_version: ${{ needs.parse-version.outputs.package_version }}
create_feature_branch: true
secrets: inherit
Loading

0 comments on commit 2e0bc8c

Please sign in to comment.