Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 56 additions & 1 deletion .github/workflows/deploy-main-branches.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Build » Deploy main branches

# NOTE: This should *not* run on tags, these are handled in the main repo
on:
push:
branches:
Expand Down Expand Up @@ -33,6 +34,7 @@ jobs:
#Strip the r/ prefix, giving us just 17.x. If this is main/develop this does nothing
echo "branch=${TEMP#r\/}" >> $GITHUB_OUTPUT


deploy-main-branches:
runs-on: ubuntu-latest
needs: detect-repo-owner
Expand Down Expand Up @@ -96,6 +98,59 @@ jobs:
git add assets
git diff --staged --quiet || git commit --amend -m "Build $(date)"


- name: Push updates
run: git push origin gh-pages --force


file-upstream-editor-pr:
name: Create upstream editor PR to incorporate build
runs-on: ubuntu-latest
needs: detect-repo-owner
permissions:
contents: write # For the release
pull-requests: write # For the PR in the upstream repo

steps:
- name: Prepare git
run: |
git config --global user.name "Editor Commit Bot"
git config --global user.email "cloud@opencast.org"

- name: Prepare GitHub SSH key
env:
DEPLOY_KEY: ${{ secrets.MODULE_PR_DEPLOY_KEY }}
run: |
install -dm 700 ~/.ssh/
echo "${DEPLOY_KEY}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan github.com >> ~/.ssh/known_hosts

- name: Clone upstream repository
run: |
git clone -b ${{ github.ref_name }} "git@github.com:${{ github.repository_owner }}/opencast.git" opencast
cd opencast
git checkout -b t/editor-$GITHUB_REF

- name: Update the editor submodule
working-directory: opencast
run: |
# Note: This could be a race condition in that rapid submodule pushes can trigger multiple PRs in short order
# and we don't have a guarantee that the update triggered by commit A does not end up finding commit B
# We are going to ignore this possibility since we almost universally want the *latest* commit, though this
# could end up causing the commit message, and the actual submodule hash to differ.
git submodule update --init --remote modules/editor
git add modules/editor
git commit -m "Updating editor to $GITHUB_REF"
git push origin t/editor-$GITHUB_REF
# This token is an account wide token which allows creation of PRs and pushes.
echo "${{ secrets.MODULE_PR_TOKEN }}" > token.txt
gh auth login --with-token < token.txt
gh pr create \
--title "Update ${{ needs.detect-repo-owner.outputs.branch }} Editor to $GITHUB_REF" \
--body "Updating Opencast ${{ needs.detect-repo-owner.outputs.branch }} Editor module to [$GITHUB_REF](https://github.com/${{ github.repository_owner }}/editor/commit/$GITHUB_REF)" \
--head=${{ github.repository_owner }}:t/editor-$GITHUB_REF \
--base ${{ github.ref_name }} \
-R ${{ github.repository_owner }}/opencast
#FIXME: fine grained PATs can't apply labels
#FIXME: classic PATs don't have the permissions because the PR isn't in an opencastproject (the user) repo
#--label editor --label maintenance \
133 changes: 0 additions & 133 deletions .github/workflows/release-build.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/release-cut-tag.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# production
/build
/target

# editor files
*.swp
Expand Down
26 changes: 4 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,29 +110,11 @@ How to cut a release for Opencast with the Github UI
5. Merge the upstream issue that the workflow above filed in [Opencast's main repository](https://github.com/opencast/opencast)


How to cut a release for Opencast manually with git
---------------------------------------------------
Editor releases
---------------

1. (Optional) Run the [Update translations](https://github.com/opencast/opencast-editor/actions/workflows/update-translations.yml) workflow, to make sure all changes from crowdin are included in the next release.

2. Switch to the commit you want to turn into the release - make sure this is the on `develop` or an `r/N.x` branch

3. Create and push a new tag
```bash
BRANCH=N.x (make sure the version you write here matches the branch you have checked out)
DATE=$(date +%Y-%m-%d)
git tag -sm "Release $BRANCH-$DATE" -s "$BRANCH-$DATE"
git push upstream "$BRANCH-$DATE":"$BRANCH-$DATE"
```

3. Wait for the [Process release](https://github.com/opencast/opencast-editor/actions/workflows/process-release.yml)
workflow to finish
- It will create a new [GitHub release](https://github.com/opencast/opencast-editor/releases)
- Review the release and make sure the notes are right, update them if not.
- By selecting the previous release, Github can generate release notes automatically
- This review isn't required to happen prior to the next step!

5. Merge the upstream issue that the workflow above filed in [Opencast's main repository](https://github.com/opencast/opencast)
The editor module no longer cuts releases itself. Opencast's release manager will create tags as appropriate and push
as part of the release process.


Opencast API used by the Editor
Expand Down
Loading
Loading