Skip to content
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

Release process follow ups #220

Merged
merged 32 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d01470e
Pass in commit to branch from when makign a new tag
glennmoy Oct 24, 2023
3e11e3b
Pass BEACON_BUDDY_GH_TOKEN
glennmoy Oct 24, 2023
931f69d
Commit + Push Tag in same step
glennmoy Oct 24, 2023
e24f1f9
Check project.version against all tags
glennmoy Oct 24, 2023
7d79350
use ncipollo/release action
glennmoy Oct 24, 2023
601f06d
add permisssions
glennmoy Oct 24, 2023
a44a982
REVERT: test pre-release workflow on push
glennmoy Oct 24, 2023
36199b5
add version number to gha
glennmoy Oct 24, 2023
c24d884
test for new version
glennmoy Oct 24, 2023
448be44
piggyback off DOCUMENTER_KEY instead
glennmoy Oct 24, 2023
b7afa56
delete LATEST_TAG env variable
glennmoy Oct 24, 2023
44a65fa
remove quotes
glennmoy Oct 24, 2023
1c216c1
don't persist credentials
glennmoy Oct 24, 2023
5a30daa
pass DOCUMENTER key as env variable
glennmoy Oct 24, 2023
e67d4b1
remove tag from release action since it should exist
glennmoy Oct 24, 2023
88b36c4
remove DOCUMENTER_KEY from git tag stage
glennmoy Oct 24, 2023
46c90b9
Revert "remove DOCUMENTER_KEY from git tag stage"
glennmoy Oct 24, 2023
71bb53d
REVERT: split up commit / tag
glennmoy Oct 25, 2023
3dbbece
Revert to commit that worked yesterdat
glennmoy Oct 25, 2023
1925e53
shouldn't need commit info
glennmoy Oct 25, 2023
9fb8585
don't need DOCUMENTER_KEY
glennmoy Oct 25, 2023
7fd9341
Commit and Tag in seperate steps
glennmoy Nov 1, 2023
b8876c3
pass sha along
glennmoy Nov 1, 2023
6271ae8
remove DOCUMENTER_KEY
glennmoy Nov 1, 2023
8916e10
rename artifacts_CI -> Release
glennmoy Nov 1, 2023
307ba3a
update docs
glennmoy Nov 1, 2023
de45f66
Build changelogs using GHA
glennmoy Nov 1, 2023
290cd7c
don't autogenerate release notes
glennmoy Nov 1, 2023
ea8304d
tidy up
glennmoy Nov 1, 2023
ba45577
Run Documenter workflow on Releases rather than Tags
glennmoy Nov 1, 2023
eaa7341
Update Project.toml
glennmoy Nov 6, 2023
a8bf476
allow comparison of non-version number tags
glennmoy Nov 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
push:
branches:
- main
tags: ["*"] # Triggers from tags ignore the `paths` filter: https://github.com/orgs/community/discussions/26273
release:
types:
- released
paths:
- "docs/**"
- ".github/workflows/Documenter.yml"
Expand All @@ -21,6 +23,7 @@ env:
build_dir: ./build
jobs:
docs:
if: github.event_name == 'release' && github.event.action == 'published'
name: Build
runs-on: ubuntu-latest
permissions:
Expand Down
45 changes: 24 additions & 21 deletions .github/workflows/Pre_release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: "Publish Pre-Release"
name: Publish Pre-Release
on:
workflow_dispatch:
inputs:
commit:
# Note: The tag itself will not be based off this commit. As we must first commit the
# updates to the Artifacts.toml, then the tag will be based off that commit.
description: The commit to branch from when making the tag
required: true

# Force a single workflow to run at a time. This ensures we don't accidentally
# try to perform concurrent publishing of releases.
concurrency: publish-release
Expand All @@ -10,31 +17,25 @@ env:
tarballs_dir: ./build/tarballs
jobs:
release:
name: "Publish Pre-Release"
name: Publish Pre-Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed determine latest tag
fetch-depth: 0 # Needed determine tags
persist-credentials: true
glennmoy marked this conversation as resolved.
Show resolved Hide resolved
ref: main
- name: Get Latest Tag
id: latest_tag
uses: WyriHaximus/github-action-get-previous-tag@v1
# TODO: in future we might need to perform backports, at which point we'll need to check
# that the project.version has not already been tagged
- name: Check for updated Project version
ref: ${{ inputs.commit }}
- name: Check for new Project version
id: project_toml
shell: julia --color=yes --project {0}
env:
LATEST_TAG: ${{ steps.latest_tag.outputs.tag }}
run: |
using Pkg.Types
project = read_project("Project.toml")
latest_tag = parse(VersionNumber, ENV["LATEST_TAG"])
tags = parse.(VersionNumber, split(readchomp(`git tag -l`), "\n"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious if you verified this? I thought maybe we'd have to do git fetch --tags

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@omus omus Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we create a tag that isn't a version number this will break. We should do:

Suggested change
tags = parse.(VersionNumber, split(readchomp(`git tag -l`), "\n"))
tags = split(readchomp(`git tag -l`), "\n")

and do a string comparison later.

Also, we can simplify this to:

Suggested change
tags = parse.(VersionNumber, split(readchomp(`git tag -l`), "\n"))
tags = readlines(`git tag -l`)

@info "Project version: project.version"
@info "Latest tag: latest_tag"
project.version > latest_tag || exit(1) # error if can't make a tag
project.version in tags && error("Tag v$(project.version) already exists")
omus marked this conversation as resolved.
Show resolved Hide resolved
glennmoy marked this conversation as resolved.
Show resolved Hide resolved
open(ENV["GITHUB_OUTPUT"], "a") do io
println(io, "version=$(project.version)")
println(io, "tag=v$(project.version)")
Expand All @@ -43,7 +44,7 @@ jobs:
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
commit: ${{ github.sha }} # pull the artifacts for the last commit on main
commit: ${{ inputs.commit }} # pull the artifacts for the given commit
name: ray_julia_libraries
path: ${{ env.tarballs_dir }}
workflow: CI.yml
Expand Down Expand Up @@ -79,11 +80,13 @@ jobs:
tag=${{ steps.project_toml.outputs.tag }}
git tag $tag ${{ steps.commit.outputs.sha }}
git push origin $tag
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4
- name: Publish Pre-Release
uses: softprops/action-gh-release@v1
uses: ncipollo/release-action@v1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switching to this action as it allows us to set the rlease as "latest release"

with:
prerelease: true
tag_name: ${{ steps.project_toml.outputs.tag }}
target_commitish: ${{ steps.commit.outputs.sha }}
generate_release_notes: true
files: ${{ env.tarballs_dir }}/*.tar.gz
tag: ${{ steps.project_toml.outputs.tag }}
artifacts: ${{ env.tarballs_dir }}/*.tar.gz
body: ${{ steps.build_changelog.outputs.changelog }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Artifacts CI
name: Publish Release
on:
workflow_dispatch:
push:
Expand Down Expand Up @@ -62,13 +62,16 @@ jobs:
with:
annotate: true
release:
name: "Publish Release"
name: Publish Release
runs-on: ubuntu-latest
permissions:
contents: write
needs: [test]
steps:
- name: Publish Release
uses: softprops/action-gh-release@v1
- name: Publish Pre-Release
uses: ncipollo/release-action@v1
with:
# Any info keys (i.e. prerelease) that are not explicitly set will retain the original
# value if there is already an existing release for the tag.
allowUpdates: true
updateOnlyUnreleased: true
prerelease: false
makeLatest: "legacy"
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Ray"
uuid = "3f779ece-f0b6-4c4f-a81a-0cb2add9eb95"
authors = ["Beacon Biosignals, Inc"]
version = "0.0.3"
version = "0.0.4-dev"
glennmoy marked this conversation as resolved.
Show resolved Hide resolved

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down
3 changes: 1 addition & 2 deletions docs/src/building-artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ Once the PR has been merged into `main` and the CI has passed you must trigger t
2. Generate the `Artifacts.toml` bindings and commit them.
3. Create a new tag and GitHub pre-release which includes the artifacts as assets.

The creation of the tag will trigger the "Artifacts CI" workflow which is responsible for verifying the generated artifacts work.
It will then promote the GitHub pre-release to a full release once those checks pass.
Then you must trigger the ["Release" GitHub Action](https://github.com/beacon-biosignals/Ray.jl/actions/workflows/Release.yml) workflow which is responsible for verifying the generated artifacts work and promoting the aforementioned pre-release to a full release, setting it to "latest" if necessary.