-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting SOURCE_DATE_EPOCH
in GitHub Actions
#175
Comments
That's nice! Maybe we should modify rattler-build to read the environment variable first :) |
How does |
For more context, normal builds are triggered by either the So, releases are always associated with an annotated tag and I use e.g. name: build/wheel
run-name: ${{
format(
'[{0}] build/wheel',
(github.event_name == 'pull_request' && format('pr/{0}', github.event.number)) ||
(github.event_name == 'push' && github.ref_name) ||
(github.event_name == 'release' && github.event.release.tag_name) ||
github.event_name
)
}}
on:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
push:
branches:
- main
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
pull_request:
branches:
- main
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
release:
types: [published] |
Just thought I'd share the snippit I use to get the
SOURCE_DATE_EPOCH
in GitHub Actions:If the build is due to a commit on a PR or a push to
main
then the timestamp of the git commit is used. If the build was triggered by a GitHub Release being published then I use the timestamp of the (annotated) tag rather than the commit.The text was updated successfully, but these errors were encountered: