Fix artifacts v4 versioning (#49028)
This commit is contained in:
@@ -180,15 +180,15 @@ Jobs that are dependent on a previous job's artifacts must wait for the dependen
|
|||||||
|
|
||||||
Job 1 performs these steps:
|
Job 1 performs these steps:
|
||||||
- Performs a math calculation and saves the result to a text file called `math-homework.txt`.
|
- Performs a math calculation and saves the result to a text file called `math-homework.txt`.
|
||||||
- Uses the `upload-artifact` action to upload the `math-homework.txt` file with the artifact name `homework_pre`.
|
- Uses the `upload-artifact` action to upload the `math-homework.txt` file with the artifact name {% ifversion artifacts-v3-deprecation %}`homework_pre`{% else %}`homework`{% endif %}.
|
||||||
|
|
||||||
Job 2 uses the result in the previous job:
|
Job 2 uses the result in the previous job:
|
||||||
- Downloads the `homework_pre` artifact uploaded in the previous job. By default, the `download-artifact` action downloads artifacts to the workspace directory that the step is executing in. You can use the `path` input parameter to specify a different download directory.
|
- Downloads the {% ifversion artifacts-v3-deprecation %}`homework_pre`{% else %}`homework`{% endif %} artifact uploaded in the previous job. By default, the `download-artifact` action downloads artifacts to the workspace directory that the step is executing in. You can use the `path` input parameter to specify a different download directory.
|
||||||
- Reads the value in the `math-homework.txt` file, performs a math calculation, and saves the result to `math-homework.txt` again, overwriting its contents.
|
- Reads the value in the `math-homework.txt` file, performs a math calculation, and saves the result to `math-homework.txt` again, overwriting its contents.
|
||||||
- Uploads the `math-homework.txt` file. As artifacts are considered immutable in `v4`, the artifact is passed a different input, `homework_final`, as a name.
|
- Uploads the `math-homework.txt` file. {% ifversion artifacts-v3-deprecation %}As artifacts are considered immutable in `v4`, the artifact is passed a different input, `homework_final`, as a name.{% else %}This upload overwrites the previously uploaded artifact because they share the same name.{% endif %}
|
||||||
|
|
||||||
Job 3 displays the result uploaded in the previous job:
|
Job 3 displays the result uploaded in the previous job:
|
||||||
- Downloads the `homework_final` artifact from Job 2.
|
- Downloads the {% ifversion artifacts-v3-deprecation %}`homework_final` artifact from Job 2.{% else %}`homework` artifact.{% endif %}
|
||||||
- Prints the result of the math equation to the log.
|
- Prints the result of the math equation to the log.
|
||||||
|
|
||||||
The full math operation performed in this workflow example is `(3 + 7) x 9 = 90`.
|
The full math operation performed in this workflow example is `(3 + 7) x 9 = 90`.
|
||||||
@@ -209,7 +209,7 @@ jobs:
|
|||||||
- name: Upload math result for job 1
|
- name: Upload math result for job 1
|
||||||
uses: {% data reusables.actions.action-upload-artifact %}
|
uses: {% data reusables.actions.action-upload-artifact %}
|
||||||
with:
|
with:
|
||||||
name: homework_pre
|
name: {% ifversion artifacts-v3-deprecation %}homework_pre{% else %}homework{% endif %}
|
||||||
path: math-homework.txt
|
path: math-homework.txt
|
||||||
|
|
||||||
job_2:
|
job_2:
|
||||||
@@ -220,7 +220,7 @@ jobs:
|
|||||||
- name: Download math result for job 1
|
- name: Download math result for job 1
|
||||||
uses: {% data reusables.actions.action-download-artifact %}
|
uses: {% data reusables.actions.action-download-artifact %}
|
||||||
with:
|
with:
|
||||||
name: homework_pre
|
name: {% ifversion artifacts-v3-deprecation %}homework_pre{% else %}homework{% endif %}
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
value=`cat math-homework.txt`
|
value=`cat math-homework.txt`
|
||||||
@@ -228,7 +228,7 @@ jobs:
|
|||||||
- name: Upload math result for job 2
|
- name: Upload math result for job 2
|
||||||
uses: {% data reusables.actions.action-upload-artifact %}
|
uses: {% data reusables.actions.action-upload-artifact %}
|
||||||
with:
|
with:
|
||||||
name: homework_final
|
name: {% ifversion artifacts-v3-deprecation %}homework_final{% else %}homework{% endif %}
|
||||||
path: math-homework.txt
|
path: math-homework.txt
|
||||||
|
|
||||||
job_3:
|
job_3:
|
||||||
@@ -239,7 +239,7 @@ jobs:
|
|||||||
- name: Download math result for job 2
|
- name: Download math result for job 2
|
||||||
uses: {% data reusables.actions.action-download-artifact %}
|
uses: {% data reusables.actions.action-download-artifact %}
|
||||||
with:
|
with:
|
||||||
name: homework_final
|
name: {% ifversion artifacts-v3-deprecation %}homework_final{% else %}homework{% endif %}
|
||||||
- name: Print the final result
|
- name: Print the final result
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
6
data/features/artifacts-v3-deprecation.yml
Normal file
6
data/features/artifacts-v3-deprecation.yml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Issue 13549
|
||||||
|
# Versioning for the Artifacts v1-3 deprecation. Feb 5, 2024: Eventually this will ship to some version of GHES, at that point, we can add the GHES versioning into this fbv file.
|
||||||
|
versions:
|
||||||
|
fpt: '*'
|
||||||
|
ghec: '*'
|
||||||
|
# ghes: 'tbd'
|
||||||
@@ -1 +1 @@
|
|||||||
actions/download-artifact@v4
|
actions/download-artifact@{% ifversion artifacts-v3-deprecation %}v4{% else %}v3{% endif %}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
actions/upload-artifact@v4
|
actions/upload-artifact@{% ifversion artifacts-v3-deprecation %}v4{% else %}v3{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user