Skip to content

Commit

Permalink
Workflow experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
negrutiu committed Jun 6, 2024
1 parent 84551c1 commit 15f20ec
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/experiments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:

jobs:
experiments:
outputs:
# accessible from other jobs as ${{needs.experiments.outputs.version}}
version: ${{steps.version.outputs.VERSION}}

runs-on: windows-latest
steps:

Expand All @@ -22,20 +26,21 @@ jobs:
echo ----------------------------------------------------
py -3 -V
py -3 -m pip list
- name: Version
- id: version
name: Version
shell: python
run: |
import os
from datetime import datetime, timezone
date = datetime.now(tz=timezone.utc)
print(f"VERSION={date.year}.{date.month}.{date.day}.${{github.run_attempt}}")
print(f"run_id=${{github.run_id}}, run_number=${{github.run_number}}, run_attempt=${{github.run_attempt}}")
print(f"GITHUB_OUTPUT={os.getenv('GITHUB_OUTPUT')}")
with open(os.getenv('GITHUB_OUTPUT'), "a") as fout:
print( f"VERSION={date.year}.{date.month}.{date.day}.${{github.run_number}}")
fout.write(f"VERSION={date.year}.{date.month}.{date.day}.${{github.run_number}}")
- name: Print version
shell: cmd
run: |
echo -- version is ${{steps.version.output.VERSION}}
echo -- version is ${{steps.version.outputs.VERSION}}

0 comments on commit 15f20ec

Please sign in to comment.