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 name: Parse input version string
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
package_version: ${{ steps.version_parser.outputs.major }}.${{ steps.version_parser.outputs.minor }}.0 package_version: ${{ steps.version_parser.outputs.major }}.${{ steps.version_parser.outputs.minor }}.0-alpha.1
branch_name: ${{ steps.version_parser.outputs.major }}.${{ steps.version_parser.outputs.minor }}
steps: steps:
- name: Parse version string - name: Parse version string
id: version_parser id: version_parser
@ -25,39 +24,8 @@ jobs:
feature-freeze: feature-freeze:
name: Process feature freeze name: Process feature freeze
runs-on: ubuntu-latest uses: Ultimaker/Cura-workflows/.github/workflows/cura-set-packages-versions.yml
needs: [parse-version] 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: with:
repository: Ultimaker/${{ matrix.repository }} cura_version: ${{ needs.parse-version.outputs.package_version }}
ref: ${{ matrix.main_branch }} create_feature_branch: true
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

View File

@ -25,10 +25,18 @@ jobs:
with: with:
input_string: ${{ inputs.cura_version }} input_string: ${{ inputs.cura_version }}
prepare-cura-repo: freeze-packages-versions:
name: Update dependencies and find RC tag name name: Freeze packges versions
runs-on: ubuntu-latest uses: Ultimaker/Cura-workflows/.github/workflows/cura-set-packages-versions.yml
needs: [parse-version] 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: outputs:
tag_name: ${{ steps.find-available-tag-name.outputs.tag_name }} tag_name: ${{ steps.find-available-tag-name.outputs.tag_name }}
steps: steps:
@ -39,21 +47,6 @@ jobs:
fetch-tags: true fetch-tags: true
fetch-depth: 0 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 - name: Find available tag name
id: find-available-tag-name id: find-available-tag-name
run: | run: |
@ -71,7 +64,7 @@ jobs:
create-tags: create-tags:
name: Create tags name: Create tags
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [parse-version, prepare-cura-repo] needs: [parse-version, find-rc-tag]
strategy: strategy:
matrix: matrix:
repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials] repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials]
@ -85,13 +78,13 @@ jobs:
- name: Create tag - name: Create tag
run: | run: |
git tag ${{ needs.prepare-cura-repo.outputs.tag_name }} git tag ${{ needs.find-rc-tag.outputs.tag_name }}
git push origin tag ${{ needs.prepare-cura-repo.outputs.tag_name }} git push origin tag ${{ needs.find-rc-tag.outputs.tag_name }}
create-dependencies-packages: create-dependencies-packages:
name: Create conan packages for dependencies name: Create conan packages for dependencies
uses: ultimaker/cura-workflows/.github/workflows/conan-package-release.yml@CURA-10769_automate_release_action 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: strategy:
matrix: matrix:
repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials] repository: [Cura, Uranium, CuraEngine, cura-binary-data, fdm_materials]