diff --git a/.github/workflows/experiments.yml b/.github/workflows/experiments.yml index ec5173c..65cbbb0 100644 --- a/.github/workflows/experiments.yml +++ b/.github/workflows/experiments.yml @@ -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: @@ -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}} \ No newline at end of file + echo -- version is ${{steps.version.outputs.VERSION}} \ No newline at end of file