-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up CI builds for new opus branch
- Loading branch information
Showing
9 changed files
with
186 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:construction: This is pre-release code for people who want to help test [what is going into the backwards-incompatible release that will support the Opus Quad](https://github.com/Deep-Symmetry/beat-link/blob/opus/CHANGELOG.md). | ||
|
||
> Don’t download this if you aren’t comfortable testing code while it is under active development! Instead, look at the [latest release](https:///github.com/Deep-Symmetry/beat-link/releases/latest). | ||
The API docs for the latest Opus-compatible preview release can be viewed [here](https://deepsymmetry.org/beatlink/opus-snapshot/apidocs/). |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e # Exit if any command fails. | ||
|
||
# See if we are creating a preview release | ||
if [ "$release_snapshot" = true ] ; then | ||
|
||
# Create (or move) the latest-preview tag locally, then push it. | ||
echo "Creating tag for opus preview release" | ||
git config --global user.name 'James Elliott' | ||
git config --global user.email 'james@deepsymmetry.org' | ||
git tag latest-opus-preview -m "The latest opus preview release" --force | ||
git push --tags | ||
|
||
# Actually create the opus preview release and upload the cross-platform Jar | ||
echo "Creating opus preview release" | ||
gh release create latest-opus-preview "$artifact_name#Library Jar" --prerelease \ | ||
--title "Opus preview release being built" \ | ||
--notes ":construction: This release is currently being built by GitHub Actions. Come back in a few minutes." | ||
|
||
else | ||
|
||
# Should not get here, we do not plan to build final releases until this branch is merged to main. | ||
echo "Canceling workflow: opus branch should only build snapshot releases!" | ||
exit 1 | ||
|
||
# Actually create the release and upload the cross-platform Jar | ||
# echo "Creating final release" | ||
# gh release create "$release_tag" "$artifact_name#Library Jar" --prerelease \ | ||
# --title "Release being built" \ | ||
# --notes ":construction: This release is currently being built by GitHub Actions. Come back in a few minutes." | ||
|
||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e # Exit if any command fails. | ||
|
||
# Check if the opus preview release exists. | ||
if gh release view latest-opus-preview --json assets --jq '.assets[].name' > preview_assets.txt ; then | ||
|
||
echo "There is an opus preview release. Deleting assets..." | ||
while read -r asset; do | ||
echo " Deleting asset $asset:" | ||
gh release delete-asset latest-opus-preview "$asset" --yes | ||
done <preview_assets.txt | ||
|
||
echo "Deleting the opus preview release itself:" | ||
gh release delete latest-opus-preview --cleanup-tag --yes | ||
|
||
else | ||
echo "No opus preview release found to clean up." | ||
fi | ||
|
||
rm -f preview_assets.txt |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e # Exit if any command fails. | ||
|
||
# There is no point in doing this if we lack the SSH key to publish the API documentation. | ||
if [ "$GUIDE_SSH_KEY" != "" ]; then | ||
|
||
# Publish the JavaDoc to the right place on the Deep Symmetry web server. | ||
if [ "$release_snapshot" != "true" ]; then | ||
echo "Should not get here, opus branch is expected to only build snapshots!" | ||
exit 1 | ||
else | ||
rsync -avz target/apidocs guides@deepsymmetry.org:/var/www/html/beatlink/opus-snapshot | ||
fi | ||
else | ||
echo "No SSH key present, not building API documentation." | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e # Exit if any command fails. | ||
|
||
# See if we are creating a preview release | ||
if [ "$release_snapshot" = true ] ; then | ||
|
||
# Update the release information on GitHub and reflect that it is ready. | ||
gh release edit latest-opus-preview --title "$release_tag (Opus) preview" --notes-file .github/resources/opus_preview_notes.md | ||
|
||
else | ||
|
||
echo "We should not be here, only snapshots should be built on the opus branch!" | ||
exit 1 | ||
|
||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Create opus library jar | ||
|
||
on: | ||
push: | ||
branches: | ||
- opus | ||
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
jobs: | ||
build_jar: | ||
name: Build library jar | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
|
||
steps: | ||
- name: Check out opus branch | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install SSH Key | ||
env: | ||
found_ssh_key: ${{ secrets.GUIDE_SSH_KEY }} | ||
if: ${{ env.found_ssh_key != '' }} | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.GUIDE_SSH_KEY }} | ||
# noinspection SpellCheckingInspection | ||
known_hosts: 'deepsymmetry.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMKq8T1IXQHNYLgO715YbxTXoVxEsJcha9h1lxyOXpa' | ||
|
||
- name: Prepare Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '11' | ||
distribution: 'corretto' | ||
|
||
- name: Determine release tag, library jar name, and snapshot status | ||
# noinspection SpellCheckingInspection | ||
run: | | ||
PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
RELEASE_TAG="v$PROJECT_VERSION" | ||
HUMAN_VERSION=${PROJECT_VERSION/SNAPSHOT/Preview} | ||
echo "release_tag=$RELEASE_TAG" >> $GITHUB_ENV | ||
echo "release_name=$PROJECT_VERSION" >> $GITHUB_ENV | ||
echo "built_name=beat-link-$PROJECT_VERSION.jar" >> $GITHUB_ENV | ||
echo "artifact_name=beat-link-$HUMAN_VERSION.jar" >> $GITHUB_ENV | ||
if [[ $RELEASE_TAG =~ .*-SNAPSHOT ]] | ||
then | ||
echo "release_snapshot=true" >> $GITHUB_ENV | ||
else | ||
echo "release_snapshot=false" >> $GITHUB_ENV | ||
fi | ||
- name: Cache Maven dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-mvn-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-mvn- | ||
- name: Install dependencies and compile | ||
run: mvn compile | ||
|
||
- name: Build library jar | ||
run: | | ||
mvn package | ||
mv target/$built_name ./$artifact_name | ||
- name: Delete any pre-existing preview release | ||
if: success() | ||
run: bash .github/scripts/delete_opus_preview.sh | ||
|
||
- name: Create release and upload library jar | ||
if: success() | ||
run: bash .github/scripts/create_opus_release.sh | ||
|
||
- name: Publish the JavaDoc | ||
if: success() | ||
env: | ||
GUIDE_SSH_KEY: ${{ secrets.GUIDE_SSH_KEY }} | ||
run: bash .github/scripts/deploy_opus_docs.sh | ||
|
||
- name: Update release title, description, and status | ||
if: success() | ||
run: bash .github/scripts/finish_opus_release.sh |
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
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