forked from alexandru-slobodcicov/liquibase-mongodb
-
Notifications
You must be signed in to change notification settings - Fork 46
52 lines (47 loc) · 2.11 KB
/
release-published.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Release Extension to Sonatype
on:
workflow_dispatch:
release:
types: [published]
jobs:
release:
uses: liquibase/build-logic/.github/workflows/[email protected]
secrets: inherit
deploy_xsd:
name: Upload xsds
runs-on: ubuntu-20.04
steps:
- name: Download liquibase mongodb xsd
uses: actions/checkout@v4
with:
# Relative path under $GITHUB_WORKSPACE to place the repository
path: liquibase-mongodb
repository: "liquibase/liquibase-mongodb"
- name: Upload to s3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.LIQUIBASEORIGIN_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.LIQUIBASEORIGIN_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
# aws s3 sync syncs directories and S3 prefixes.
run: |
aws s3 sync liquibase-mongodb/src/main/resources/www.liquibase.org/xml/ns/mongodb/ s3://liquibaseorg-origin/xml/ns/mongodb/ --content-type application/octet-stream --only-show-errors
- name: Index.htm file upload
env:
AWS_ACCESS_KEY_ID: ${{ secrets.LIQUIBASEORIGIN_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.LIQUIBASEORIGIN_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
# List all xsd and htm files in repository. Copy index.htm to temporary folder
# Add links for all xsd files to index.htm file (except liquibase-mongodb-latest.xsd and index.htm)
# Sync index.htm with the s3
run: |
search_dir=liquibase-mongodb/src/main/resources/www.liquibase.org/xml/ns/mongodb
filenames=`ls -1 $search_dir`
mkdir index-file
cp $search_dir/index.htm index-file/
for entry in $filenames
do
if [[ "$entry" != "liquibase-mongodb-latest.xsd" ]] && [[ "$entry" != "index.htm" ]] ;then
sed -ie "s/<\/ul>/ <li><a href=\"\/xml\/ns\/mongodb\/${entry}\">${entry}<\/a><\/li>\n<\/ul>/" index-file/index.htm
fi
done
aws s3 sync index-file s3://liquibaseorg-origin/xml/ns/mongodb/ --only-show-errors