Use reusable action to freeze packages versions

This commit is contained in:
Erwan MATHIEU 2024-06-06 10:43:17 +02:00
parent 3568538d2d
commit 8a23981b89
2 changed files with 20 additions and 59 deletions

View file

@ -14,8 +14,7 @@ jobs:
name: Parse input version string
runs-on: ubuntu-latest
outputs:
package_version: ${{ steps.version_parser.outputs.major }}.${{ steps.version_parser.outputs.minor }}.0
branch_name: ${{ steps.version_parser.outputs.major }}.${{ steps.version_parser.outputs.minor }}
package_version: ${{ steps.version_parser.outputs.major }}.${{ steps.version_parser.outputs.minor }}.0-alpha.1
steps:
- name: Parse version string
id: version_parser
@ -25,39 +24,8 @@ jobs:
feature-freeze:
name: Process feature freeze
runs-on: ubuntu-latest
uses: Ultimaker/Cura-workflows/.github/workflows/cura-set-packages-versions.yml
needs: [parse-version]
strategy:
matrix:
repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials]
include:
- main_branch: main
- repository: Cura
main_branch: CURA-10769_automate_release_action
- repository: fdm_materials
main_branch: master
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
repository: Ultimaker/${{ matrix.repository }}
ref: ${{ matrix.main_branch }}
token: ${{ secrets.CURA_AUTORELEASE_PAT }}
- name: Update conan package version
run: |
PACKAGE_VERSION=${{ needs.parse-version.outputs.package_version }}
sed -i "s/version:.*/version: \"$PACKAGE_VERSION\"/g" conandata.yml
- name: Update resources conan package version
if: ${{ matrix.repository == 'Cura' }}
run: |
PACKAGE_VERSION=${{ needs.parse-version.outputs.package_version }}
sed -i "s/version:.*/version: \"$PACKAGE_VERSION\"/g" resources/conandata.yml
- name: Create branch and commit
uses: stefanzweifel/git-auto-commit-action@v5.0.1
with:
commit_message: Set conan package version ${{ needs.parse-version.outputs.package_version }}
branch: ${{ needs.parse-version.outputs.branch_name }}
create_branch: true
with:
cura_version: ${{ needs.parse-version.outputs.package_version }}
create_feature_branch: true

View file

@ -25,10 +25,18 @@ jobs:
with:
input_string: ${{ inputs.cura_version }}
prepare-cura-repo:
name: Update dependencies and find RC tag name
runs-on: ubuntu-latest
freeze-packages-versions:
name: Freeze packges versions
uses: Ultimaker/Cura-workflows/.github/workflows/cura-set-packages-versions.yml
needs: [parse-version]
with:
cura_version: ${{ inputs.cura_version }}
create_feature_branch: false
find-rc-tag:
name: Find RC tag name
runs-on: ubuntu-latest
needs: [freeze-packages-versions]
outputs:
tag_name: ${{ steps.find-available-tag-name.outputs.tag_name }}
steps:
@ -39,21 +47,6 @@ jobs:
fetch-tags: true
fetch-depth: 0
- name: Update Cura dependencies
run: |
PACKAGE_VERSION=${{ inputs.cura_version }}
sed -i "s/\"uranium\/.*/\"uranium\/$PACKAGE_VERSION\"/g" conandata.yml
sed -i "s/\"cura_resources\/.*/\"cura_resources\/$PACKAGE_VERSION\"/g" conandata.yml
sed -i "s/\"curaengine\/.*/\"curaengine\/$PACKAGE_VERSION\"/g" conandata.yml
sed -i "s/\"cura_binary_data\/.*/\"cura_binary_data\/$PACKAGE_VERSION\"/g" conandata.yml
sed -i "s/\"fdm_materials\/.*/\"fdm_materials\/$PACKAGE_VERSION\"/g" conandata.yml
- name: Commit new dependencies versioning
uses: stefanzweifel/git-auto-commit-action@v5.0.1
with:
commit_message: Set dependencies version ${{ inputs.cura_version }}
file_pattern: conandata.yml
- name: Find available tag name
id: find-available-tag-name
run: |
@ -71,7 +64,7 @@ jobs:
create-tags:
name: Create tags
runs-on: ubuntu-latest
needs: [parse-version, prepare-cura-repo]
needs: [parse-version, find-rc-tag]
strategy:
matrix:
repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials]
@ -85,13 +78,13 @@ jobs:
- name: Create tag
run: |
git tag ${{ needs.prepare-cura-repo.outputs.tag_name }}
git push origin tag ${{ needs.prepare-cura-repo.outputs.tag_name }}
git tag ${{ needs.find-rc-tag.outputs.tag_name }}
git push origin tag ${{ needs.find-rc-tag.outputs.tag_name }}
create-dependencies-packages:
name: Create conan packages for dependencies
uses: ultimaker/cura-workflows/.github/workflows/conan-package-release.yml@CURA-10769_automate_release_action
needs: [parse-version, prepare-cura-repo]
needs: [parse-version, freeze-packages-versions]
strategy:
matrix:
repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials]