Skip to content

Use constructed path #9

Use constructed path

Use constructed path #9

Workflow file for this run

name: Nexus Deployment
on:
push:
branches:
- main
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: npm install
- name: Build and Package Release
run: npm run package
- name: Generate Metadata
run: |
sudo apt install libarchive-zip-perl -y
jq --null-input \
--arg name "GameZIP Mounter" \
--arg desc "An extension that mounts files from entries using the modern format." \
--arg date $(date +%s) \
--arg download $(du -b extension.fplx | awk '{print $1}') \
--arg install $(7z l extension.fplx | tail -n 1 | awk '{print $3}') \
--arg path "Data/Extensions" \
--arg hash $(crc32 extension.fplx) \
'{
"title": $name,
"description": $desc,
"date-modified": $date,
"download-size": $download,
"install-size": $install,
"path": $path,
"crc32": $hash
}' > metadata.json
- name: Deploy File to Nexus
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: https://nexus-dev.unstable.life
username: github
password: ${{ secrets.NEXUS_PASSWORD }}
format: raw
repository: components
coordinates: directory=/
assets: filename=core-server-automount.zip
filename: extension.fplx
- name: Deploy Metadata to Nexus
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: https://nexus-dev.unstable.life
username: github
password: ${{ secrets.NEXUS_PASSWORD }}
format: raw
repository: components
coordinates: directory=/
assets: filename=core-server-automount.json
filename: metadata.json
- name: Generate components.xml
run: |
git clone https://gitlab.unstable.life/flashpoint/docker/nexus-deploy-action.git nexus
cd nexus
python3 ./merge-metadata.py "https://nexus-dev.unstable.life/service/rest/v1/search?repository=development&name=*.json" components.xml "https://nexus-dev.unstable.life/repository/development/"
- name: Deploy components.xml to Nexus
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: https://nexus-dev.unstable.life
username: github
password: ${{ secrets.NEXUS_PASSWORD }}
format: raw
repository: components
coordinates: directory=/
assets: filename=components.xml
filename: ./nexus/components.xml
- name: Deploy components.xml to Nexus
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: https://nexus-dev.unstable.life
username: github
password: ${{ secrets.NEXUS_PASSWORD }}
format: raw
repository: components
coordinates: directory=/
assets: filename=components.xml
filename: ./nexus/components.xml