Skip to content

Commit bd54b25

Browse files
committed
Merge branch 'develop' into metadata-saved-notification
2 parents b67f7a9 + 92c4d34 commit bd54b25

233 files changed

Lines changed: 4723 additions & 3960 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/demo-page.html

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/get-release-server.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
if [ $# -ne 1 ]; then
4+
echo "Usage: $0 OC_VERSION"
5+
echo " eg: $0 r/16.x -> Returns the current correct server for r/16.x"
6+
exit 1
7+
fi
8+
9+
git clone https://github.com/opencast/opencast.git ~/opencast
10+
cd ~/opencast
11+
12+
#Get the list of *all* branches in the format remotes/origin/r/N.m
13+
#grep for r/N.x
14+
#then use cut to remove remotes/origin
15+
ary=( `git branch -a | grep 'r/[0-9]*.x' | head -n 3 | cut -f 3- -d '/'` )
16+
17+
#Iterate through the array above.
18+
#If the script input matches the first item, spit out develop
19+
#If the script iput matches hte second item... etc
20+
#If it doesn't match anything, then don't say anything
21+
for i in "${!ary[@]}"
22+
do
23+
if [[ "${ary[$i]}" = "$1" ]]; then
24+
if [[ $i -eq 0 ]]; then
25+
echo "develop.opencast.org"
26+
elif [[ $i -eq 1 ]]; then
27+
echo "stable.opencast.org"
28+
elif [[ $i -eq 2 ]]; then
29+
echo "legacy.opencast.org"
30+
fi
31+
fi
32+
done
Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,26 @@
11
on:
2-
push:
3-
tags:
4-
- '*-*-*'
2+
workflow_dispatch:
53

6-
name: Create release draft
4+
name: Create release tag
75

86
jobs:
97
build:
10-
name: Create release from tag
8+
name: Create release tag
119
runs-on: ubuntu-latest
1210
steps:
1311
- name: checkout code
1412
uses: actions/checkout@v4
15-
16-
- name: get node.js
17-
uses: actions/setup-node@v4
1813
with:
19-
node-version: 20
20-
21-
- name: download dependencies
22-
run: npm ci
14+
fetch-depth: 0
2315

24-
- name: build release
25-
env:
26-
PUBLIC_URL: /admin-ui
27-
run: npm run build
16+
- name: prepare git
17+
run: |
18+
git config --global user.email 'cloud@opencast.org'
19+
git config --global user.name 'Release Bot'
2820
29-
- name: create release tarball
30-
working-directory: build
31-
run: tar -czf "../oc-admin-ui-$(date -u +%F).tar.gz" *
32-
33-
- name: create new release
34-
uses: softprops/action-gh-release@v2
35-
with:
36-
files: ./oc-admin-ui-*.tar.gz
37-
draft: true
38-
fail_on_unmatched_files: true
39-
generate_release_notes: true
21+
- name: tag and push
22+
run: |
23+
export TEMP=${{ github.ref_name }}
24+
export TAG=${TEMP#r\/}-`date +%Y-%m-%d`
25+
git tag $TAG
26+
git push origin $TAG

.github/workflows/deploy-main.yml

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: Publish Test Page
33
on:
44
push:
55
branches:
6-
- main
6+
- develop
7+
- r/*.x
78

89
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref }}
10-
cancel-in-progress: true
10+
group: ${{ github.workflow }}
1111

1212
jobs:
1313
build:
@@ -25,41 +25,44 @@ jobs:
2525
- name: download dependencies
2626
run: npm ci
2727

28+
- name: determine the correct test server
29+
id: vite-url
30+
run: echo "VITE_TEST_SERVER_URL=`./.github/get-release-server.sh ${{ github.ref_name }}`" >> GITHUB_ENV
31+
2832
- name: build project
2933
env:
34+
VITE_TEST_SERVER_URL: ${{ steps.vite-url.outputs.VITE_TEST_SERVER_URL }}
3035
NODE_ENV: development
31-
VITE_TEST_SERVER_URL: "https://develop.opencast.org"
3236
VITE_TEST_SERVER_AUTH: "admin:opencast"
3337
run: npm run build
3438

35-
- name: create pages directory
36-
run: mkdir gh-pages
37-
38-
- name: include admin interface
39-
run: mv build gh-pages/admin-ui
40-
41-
- name: include landing page
42-
run: cp .github/demo-page.html gh-pages/index.html
43-
44-
- name: upload test page artifact
45-
uses: actions/upload-pages-artifact@v3
46-
with:
47-
path: ./gh-pages
48-
49-
deploy:
50-
if: github.repository_owner == 'opencast'
51-
needs: build
52-
53-
permissions:
54-
pages: write
55-
id-token: write
39+
- name: Prepare git
40+
run: |
41+
git config --global user.name "Release Bot"
42+
git config --global user.email "cloud@opencast.org"
5643
57-
environment:
58-
name: github-pages
59-
url: ${{ steps.deployment.outputs.page_url }}
44+
- name: Commit new version
45+
run: |
46+
git fetch origin
47+
git checkout gh-pages
48+
#Temp becomes something like r/17.x
49+
export TEMP=${{ github.ref_name }}
50+
#Strip the r/ prefix, giving us just 17.x. If this is main/develop this does nothing
51+
export TARGET=${TEMP#r\/}
52+
# Update gh-pages
53+
rm -rf $TARGET
54+
mkdir -p $TARGET
55+
cp -r build/* $TARGET
56+
#Generate an index, in case anyone lands at the root of the test domain
57+
echo '<html><body><ul>' > index.html
58+
find . -mindepth 1 -maxdepth 1 -type d \
59+
| grep -v .git \
60+
| sort -r \
61+
| sed 's/^\(.*\)$/<li><a href=\1>\1<\/a><\/li>/' >> index.html
62+
echo '</ul></body></html>' >> index.html
63+
git add $TARGET
64+
git diff --staged --quiet || git commit --amend -m "Build $(date)"
6065
61-
runs-on: ubuntu-latest
62-
steps:
63-
- name: deploy to GitHub Pages
64-
id: deployment
65-
uses: actions/deploy-pages@v4
66+
- name: Push updates
67+
run: |
68+
git push origin gh-pages --force

.github/workflows/deploy-test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,22 @@ jobs:
2424
ref: ${{ github.event.pull_request.head.ref }}
2525
repository: ${{ github.event.pull_request.head.repo.full_name }}
2626

27-
- name: get Node.js
27+
- name: get node.js
2828
uses: actions/setup-node@v4
2929
with:
3030
node-version: 20
3131

3232
- name: download dependencies
3333
run: npm ci
3434

35+
- name: determine the correct test server
36+
id: vite-url
37+
run: echo "VITE_TEST_SERVER_URL=`./.github/get-release-server.sh ${{ github.base_ref }}`" >> GITHUB_ENV
38+
3539
- name: build app
3640
env:
37-
PUBLIC_URL: /${{ steps.build-path.outputs.build }}
41+
VITE_TEST_SERVER_URL: ${{ steps.vite-url.outputs.VITE_TEST_SERVER_URL }}
3842
NODE_ENV: development
39-
VITE_TEST_SERVER_URL: "https://develop.opencast.org"
4043
VITE_TEST_SERVER_AUTH: "admin:opencast"
4144
run: npm run build
4245

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
tags:
5+
# CF: 17.x-YYYY-MM-DD
6+
- '*.x-*-*-*'
7+
8+
name: Create release
9+
jobs:
10+
build:
11+
name: Create release from tag
12+
if: github.repository_owner == 'opencast'
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write #for the release
16+
pull-requests: write #For the PR in the upstream repo
17+
18+
steps:
19+
- name: checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: get node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
27+
- name: download dependencies
28+
run: npm ci
29+
30+
- name: build release
31+
env:
32+
PUBLIC_URL: /admin-ui
33+
run: npm run build
34+
35+
- name: create release tarball
36+
working-directory: build
37+
run: |
38+
tar -czf "../oc-admin-ui-$(git describe --tags).tar.gz" *
39+
echo INTERFACE_CHECKSUM=`sha256sum oc-admin-ui-$(git describe --tags).tar.gz | cut -f 1 -d " "` >> $GITHUB_ENV
40+
echo INTERFACE_TAG=$(git describe --tags) >> $GITHUB_ENV
41+
echo BASE_BRANCH=$(git describe --tags | cut -c 1-4) >> $GITHUB_ENV
42+
43+
- name: create new release
44+
uses: softprops/action-gh-release@v2
45+
with:
46+
files: oc-admin-ui-*.tar.gz
47+
fail_on_unmatched_files: true
48+
generate_release_notes: true
49+
50+
- name: Prepare git
51+
run: |
52+
git config --global user.name "Release Bot"
53+
git config --global user.email "cloud@opencast.org"
54+
55+
- name: Prepare GitHub SSH key
56+
env:
57+
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
58+
run: |
59+
install -dm 700 ~/.ssh/
60+
echo "${DEPLOY_KEY}" > ~/.ssh/id_ed25519
61+
chmod 600 ~/.ssh/id_ed25519
62+
ssh-keyscan github.com >> ~/.ssh/known_hosts
63+
64+
- name: Clone upstream repository
65+
run: |
66+
#This token is an account wide token which allows creation of PRs and pushes.
67+
#echo "GH_TOKEN=${{ secrets.ACCESS_TOKEN }}" >> token.txt
68+
#gh auth login --with-token < token.txt
69+
git clone -b r/$BASE_BRANCH "git@github.com:opencast/opencast.git" ~/opencast
70+
cd ~/opencast
71+
git checkout -b t/admin-ui-$INTERFACE_TAG
72+
73+
- name: Update the admin ui pom file
74+
#env:
75+
# GH_TOKEN: ${{ github.token }}
76+
run: |
77+
cd ~/opencast
78+
sed -i "s#<interface.sha256>.*</interface.sha256>#<interface.sha256>$INTERFACE_CHECKSUM</interface.sha256>#" modules/admin-ui-interface/pom.xml
79+
sed -i "s#<interface.url>.*</interface.url>#<interface.url>https://github.com/opencast/opencast-admin-interface/releases/download/$INTERFACE_TAG/oc-admin-ui-$INTERFACE_TAG.tar.gz</interface.url>#" modules/admin-ui-interface/pom.xml
80+
git add modules/admin-ui-interface/pom.xml
81+
git commit -m "Updating admin ui to $INTERFACE_TAG"
82+
git push origin t/admin-ui-$INTERFACE_TAG
83+
#This token is an account wide token which allows creation of PRs and pushes.
84+
echo "${{ secrets.PR_TOKEN }}" > token.txt
85+
gh auth login --with-token < token.txt
86+
gh pr create --title "Update $BASE_BRANCH Admin UI to $INTERFACE_TAG" --label admin-ui --label maintenance --body "Updating Opencast $BASE_BRANCH Admin UI module to $INTERFACE_TAG" --head=opencast:t/admin-ui-$INTERFACE_TAG --base r/$BASE_BRANCH -R opencast/opencast

eslint.config.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,12 @@ export default [
1111
{
1212
rules: {
1313
// TODO: We want to turn these on eventually
14-
"arrow-parens": "off",
1514
"camelcase": "off",
16-
"comma-dangle": "off",
1715
"indent": "off",
18-
"keyword-spacing": "off",
1916
"max-len": "off",
20-
"no-extra-boolean-cast": "off",
2117
"no-tabs": "off",
2218
"no-unused-expressions": "off",
23-
"object-curly-spacing": "off",
2419
"prefer-const": "off",
25-
"quotes": "off",
26-
"semi": "off",
2720
"spaced-comment": "off",
2821
"@typescript-eslint/await-thenable": "off",
2922
"@typescript-eslint/no-explicit-any": "off",
@@ -39,7 +32,7 @@ export default [
3932
"@typescript-eslint/no-unsafe-return": "off",
4033
"@typescript-eslint/require-await": "off",
4134
"@typescript-eslint/unbound-method": "off",
42-
}
43-
}
35+
},
36+
},
4437
];
4538

0 commit comments

Comments
 (0)