Skip to content

Commit 658d4b3

Browse files
authored
[dagster-cloud-action] automatically bump version action tag (#241)
1 parent c622965 commit 658d4b3

5 files changed

Lines changed: 44 additions & 20 deletions

File tree

github/serverless/branch_deployments.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ jobs:
2424
steps:
2525
- name: Prerun Checks
2626
id: prerun
27-
uses: dagster-io/dagster-cloud-action/actions/utils/prerun@v1.11.12
27+
uses: dagster-io/dagster-cloud-action/actions/utils/prerun@v0.1
2828

2929
- name: Launch Docker Deploy
3030
if: steps.prerun.outputs.result == 'docker-deploy'
3131
id: parse-workspace
32-
uses: dagster-io/dagster-cloud-action/actions/utils/parse_workspace@v1.11.12
32+
uses: dagster-io/dagster-cloud-action/actions/utils/parse_workspace@v0.1
3333
with:
3434
dagster_cloud_file: $DAGSTER_CLOUD_FILE
3535

@@ -42,7 +42,7 @@ jobs:
4242

4343
- name: Python Executable Deploy
4444
if: steps.prerun.outputs.result == 'pex-deploy'
45-
uses: dagster-io/dagster-cloud-action/actions/build_deploy_python_executable@v1.11.12
45+
uses: dagster-io/dagster-cloud-action/actions/build_deploy_python_executable@v0.1
4646
with:
4747
dagster_cloud_file: "$GITHUB_WORKSPACE/project-repo/$DAGSTER_CLOUD_FILE"
4848
build_output_dir: "$GITHUB_WORKSPACE/build"
@@ -65,7 +65,7 @@ jobs:
6565
with:
6666
ref: ${{ github.head_ref }}
6767
- name: Build and deploy to Dagster Cloud serverless
68-
uses: dagster-io/dagster-cloud-action/actions/serverless_branch_deploy@v1.11.12
68+
uses: dagster-io/dagster-cloud-action/actions/serverless_branch_deploy@v0.1
6969
with:
7070
dagster_cloud_api_token: ${{ secrets.DAGSTER_CLOUD_API_TOKEN }}
7171
location: ${{ toJson(matrix.location) }}

github/serverless/dbt/branch_deployments.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
steps:
2727
- name: Prerun Checks
2828
id: prerun
29-
uses: dagster-io/dagster-cloud-action/actions/utils/prerun@v1.11.12
29+
uses: dagster-io/dagster-cloud-action/actions/utils/prerun@v0.1
3030

3131
- name: Launch Docker Deploy
3232
if: steps.prerun.outputs.result == 'docker-deploy'
3333
id: parse-workspace
34-
uses: dagster-io/dagster-cloud-action/actions/utils/parse_workspace@v1.11.12
34+
uses: dagster-io/dagster-cloud-action/actions/utils/parse_workspace@v0.1
3535
with:
3636
dagster_cloud_file: $DAGSTER_CLOUD_FILE
3737

@@ -45,7 +45,7 @@ jobs:
4545
- name: Validate configuration
4646
id: ci-validate
4747
if: steps.prerun.outputs.result == 'pex-deploy'
48-
uses: dagster-io/dagster-cloud-action/actions/utils/dagster-cloud-cli@v1.11.12
48+
uses: dagster-io/dagster-cloud-action/actions/utils/dagster-cloud-cli@v0.1
4949
with:
5050
command: "ci check --project-dir project-repo --dagster-cloud-yaml-path ${{ env.DAGSTER_CLOUD_FILE }}"
5151
env:
@@ -55,7 +55,7 @@ jobs:
5555
- name: Initialize build session
5656
id: ci-init
5757
if: steps.prerun.outputs.result == 'pex-deploy'
58-
uses: dagster-io/dagster-cloud-action/actions/utils/ci-init@v1.11.12
58+
uses: dagster-io/dagster-cloud-action/actions/utils/ci-init@v0.1
5959
with:
6060
project_dir: project-repo
6161
dagster_cloud_yaml_path: ${{ env.DAGSTER_CLOUD_FILE }}
@@ -74,7 +74,7 @@ jobs:
7474

7575
- name: Python Executable Deploy
7676
if: steps.prerun.outputs.result == 'pex-deploy'
77-
uses: dagster-io/dagster-cloud-action/actions/build_deploy_python_executable@v1.11.12
77+
uses: dagster-io/dagster-cloud-action/actions/build_deploy_python_executable@v0.1
7878
with:
7979
dagster_cloud_file: "$GITHUB_WORKSPACE/project-repo/$DAGSTER_CLOUD_FILE"
8080
build_output_dir: "$GITHUB_WORKSPACE/build"
@@ -97,7 +97,7 @@ jobs:
9797
with:
9898
ref: ${{ github.head_ref }}
9999
- name: Build and deploy to Dagster Cloud serverless
100-
uses: dagster-io/dagster-cloud-action/actions/serverless_branch_deploy@v1.11.12
100+
uses: dagster-io/dagster-cloud-action/actions/serverless_branch_deploy@v0.1
101101
with:
102102
dagster_cloud_api_token: ${{ secrets.DAGSTER_CLOUD_API_TOKEN }}
103103
location: ${{ toJson(matrix.location) }}

github/serverless/dbt/deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ jobs:
2828
steps:
2929
- name: Prerun Checks
3030
id: prerun
31-
uses: dagster-io/dagster-cloud-action/actions/utils/prerun@v1.11.12
31+
uses: dagster-io/dagster-cloud-action/actions/utils/prerun@v0.1
3232

3333
- name: Launch Docker Deploy
3434
if: steps.prerun.outputs.result == 'docker-deploy'
3535
id: parse-workspace
36-
uses: dagster-io/dagster-cloud-action/actions/utils/parse_workspace@v1.11.12
36+
uses: dagster-io/dagster-cloud-action/actions/utils/parse_workspace@v0.1
3737
with:
3838
dagster_cloud_file: $DAGSTER_CLOUD_FILE
3939

@@ -47,14 +47,14 @@ jobs:
4747
- name: Validate configuration
4848
id: ci-validate
4949
if: steps.prerun.outputs.result == 'pex-deploy'
50-
uses: dagster-io/dagster-cloud-action/actions/utils/dagster-cloud-cli@v1.11.12
50+
uses: dagster-io/dagster-cloud-action/actions/utils/dagster-cloud-cli@v0.1
5151
with:
5252
command: "ci check --project-dir project-repo --dagster-cloud-yaml-path ${{ env.DAGSTER_CLOUD_FILE }}"
5353

5454
- name: Initialize build session
5555
id: ci-init
5656
if: steps.prerun.outputs.result == 'pex-deploy'
57-
uses: dagster-io/dagster-cloud-action/actions/utils/ci-init@v1.11.12
57+
uses: dagster-io/dagster-cloud-action/actions/utils/ci-init@v0.1
5858
with:
5959
project_dir: project-repo
6060
dagster_cloud_yaml_path: ${{ env.DAGSTER_CLOUD_FILE }}
@@ -74,7 +74,7 @@ jobs:
7474

7575
- name: Python Executable Deploy
7676
if: steps.prerun.outputs.result == 'pex-deploy'
77-
uses: dagster-io/dagster-cloud-action/actions/build_deploy_python_executable@v1.11.12
77+
uses: dagster-io/dagster-cloud-action/actions/build_deploy_python_executable@v0.1
7878
with:
7979
dagster_cloud_file: "$GITHUB_WORKSPACE/project-repo/$DAGSTER_CLOUD_FILE"
8080
build_output_dir: "$GITHUB_WORKSPACE/build"
@@ -97,7 +97,7 @@ jobs:
9797
with:
9898
ref: ${{ github.head_ref }}
9999
- name: Build and deploy to Dagster Cloud serverless
100-
uses: dagster-io/dagster-cloud-action/actions/serverless_prod_deploy@v1.11.12
100+
uses: dagster-io/dagster-cloud-action/actions/serverless_prod_deploy@v0.1
101101
with:
102102
dagster_cloud_api_token: ${{ secrets.DAGSTER_CLOUD_API_TOKEN }}
103103
location: ${{ toJson(matrix.location) }}

github/serverless/deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
steps:
2727
- name: Prerun Checks
2828
id: prerun
29-
uses: dagster-io/dagster-cloud-action/actions/utils/prerun@v1.11.12
29+
uses: dagster-io/dagster-cloud-action/actions/utils/prerun@v0.1
3030

3131
- name: Launch Docker Deploy
3232
if: steps.prerun.outputs.result == 'docker-deploy'
3333
id: parse-workspace
34-
uses: dagster-io/dagster-cloud-action/actions/utils/parse_workspace@v1.11.12
34+
uses: dagster-io/dagster-cloud-action/actions/utils/parse_workspace@v0.1
3535
with:
3636
dagster_cloud_file: $DAGSTER_CLOUD_FILE
3737

@@ -44,7 +44,7 @@ jobs:
4444

4545
- name: Python Executable Deploy
4646
if: steps.prerun.outputs.result == 'pex-deploy'
47-
uses: dagster-io/dagster-cloud-action/actions/build_deploy_python_executable@v1.11.12
47+
uses: dagster-io/dagster-cloud-action/actions/build_deploy_python_executable@v0.1
4848
with:
4949
dagster_cloud_file: "$GITHUB_WORKSPACE/project-repo/$DAGSTER_CLOUD_FILE"
5050
build_output_dir: "$GITHUB_WORKSPACE/build"
@@ -67,7 +67,7 @@ jobs:
6767
with:
6868
ref: ${{ github.head_ref }}
6969
- name: Build and deploy to Dagster Cloud serverless
70-
uses: dagster-io/dagster-cloud-action/actions/serverless_prod_deploy@v1.11.12
70+
uses: dagster-io/dagster-cloud-action/actions/serverless_prod_deploy@v0.1
7171
with:
7272
dagster_cloud_api_token: ${{ secrets.DAGSTER_CLOUD_API_TOKEN }}
7373
location: ${{ toJson(matrix.location) }}

scripts/release.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,29 @@ def update_docker_action_references(
216216
f.write(text)
217217

218218

219+
@app.command()
220+
def update_action_version_references(
221+
version_tag: str,
222+
glob_patterns: List[str] = ["github/**/*.yml", "github/**/*.yaml", "gitlab/**/*.yml", "gitlab/**/*.yaml"],
223+
):
224+
"""Update dagster-cloud-action version references in workflow templates."""
225+
info(f"Updating action version references to v{version_tag}")
226+
with chdir("."):
227+
for pattern in glob_patterns:
228+
for path in glob.glob(pattern, recursive=True):
229+
input_text = open(path, encoding="utf-8").read()
230+
# Replace @v0.1 or any @vX.Y.Z pattern after dagster-cloud-action/
231+
text = re.sub(
232+
r'(dagster-io/dagster-cloud-action/[^@\s]+)@v[0-9.]+',
233+
rf'\1@v{version_tag}',
234+
input_text
235+
)
236+
if text != input_text:
237+
print(path)
238+
with open(path, "w", encoding="utf-8") as f:
239+
f.write(text)
240+
241+
219242
@app.command()
220243
def create_rc(
221244
version_tag: str,
@@ -239,6 +262,7 @@ def create_rc(
239262
run_tests()
240263
build_docker_action(version_tag, publish_docker_action)
241264
update_docker_action_references(version_tag)
265+
update_action_version_references(version_tag)
242266
info(f"Updated working directory for {version_tag}")
243267

244268

0 commit comments

Comments
 (0)