Skip to content

Upload Release Assets #42

Upload Release Assets

Upload Release Assets #42

Workflow file for this run

on:
release:
types: [created]
name: Upload Release Assets
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup Node for theme
uses: actions/setup-node@v2
with:
node-version: '20.11'
cache: 'npm'
cache-dependency-path: './theme'
- working-directory: './theme'
run: npm ci && npm run build:css
- name: Build Theme
run: |
mkdir -p ./temp/wpcloud-station
cd ./theme
zip -r ../temp/wpcloud-station/theme.zip . [email protected]
cd ../temp/wpcloud-station
unzip theme.zip
cd ../
zip -r ./theme.zip ./wpcloud-station
rm -rf temp
- name: Setup Node for plugin
uses: actions/setup-node@v2
with:
node-version: '20.11'
cache: 'npm'
cache-dependency-path: './plugin'
- working-directory: './plugin'
run: npm ci && npm run build
- name: Build plugin
run: |
mkdir -p ./temp/wpcloud-station
cd ./plugin
zip -r ../temp/wpcloud-station/plugin.zip . [email protected]
cd ../temp/wpcloud-station
unzip plugin.zip
cd ../
zip -r ./plugin.zip wpcloud-station
rm -rf temp
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload Plugin Artifact
id: upload-plugin-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.get_release.outputs.upload_url }}
asset_path: ./plugin.zip
asset_name: wpcloud-station-plugin.zip
asset_content_type: application/zip
- name: Upload Theme Artifact
id: upload-theme-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.get_release.outputs.upload_url }}
asset_path: ./theme.zip
asset_name: wpcloud-station-theme.zip
asset_content_type: application/zip