FIXUP: typo #32
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
push: | |
# 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 | |
env: | |
build_dir: ./build | |
tarballs_dir: ./build/tarballs | |
jobs: | |
release: | |
name: Publish Pre-Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Needed determine tags | |
persist-credentials: true | |
ref: ${{ inputs.commit }} | |
- name: Check for new Project version | |
id: project_toml | |
shell: julia --color=yes --project {0} | |
run: | | |
using Pkg.Types | |
project = read_project("Project.toml") | |
project_version_tag = "v$(project.version)" | |
@info "Project version: $project_version_tag" | |
tags = readlines(`git tag -l`) | |
project_version_tag in tags && error("Tag $project_version_tag already exists") | |
open(ENV["GITHUB_OUTPUT"], "a") do io | |
println(io, "tag=$(project_version_tag)") | |
end | |
- name: Download artifacts | |
id: download-artifact | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
commit: ${{ inputs.commit }} # pull the artifacts for the given commit | |
name: ray_julia_libraries | |
path: ${{ env.tarballs_dir }} | |
workflow: CI.yml | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: "1.8" | |
arch: "x64" | |
- uses: julia-actions/cache@v1 | |
with: | |
cache-name: "${{ github.workflow }}-${{ github.job }}" | |
- name: Update Artifacts.toml | |
shell: julia --color=yes --project {0} | |
run: | | |
using Pkg | |
Pkg.instantiate() | |
include(joinpath(pwd(), "bind_artifacts.jl")) | |
bind_artifacts() | |
working-directory: ${{ env.build_dir }} | |
- name: Commit Changes | |
id: commit | |
run: | | |
# Alternatively environment variables can be used but both author/committer need to be set | |
# https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#_committing | |
git config user.name beacon-buddy | |
git config user.email beacon-buddy@beacon.bio | |
msg="Update Artifacts.toml to use ${{ steps.project_toml.outputs.tag }} assets" | |
git checkout --detach | |
git commit -m "$msg" -- Artifacts.toml | |
echo "sha=$(git rev-parse HEAD)" | tee -a "$GITHUB_OUTPUT" | |
- name: Tag and push | |
run: | | |
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: ncipollo/release-action@v1 | |
with: | |
prerelease: true | |
tag: ${{ steps.project_toml.outputs.tag }} | |
artifacts: ${{ env.tarballs_dir }}/*.tar.gz | |
body: ${{ steps.build_changelog.outputs.changelog }} |