Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
ci(plugin): fix build-plugin workflow (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyshx authored Jun 21, 2023
1 parent 0509a25 commit 030e72c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/build-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,33 +47,35 @@ jobs:
- name: Test
run: yarn test
- name: Build
run: yarn build
run: yarn build:plugin
- name: Pack
run: mv dist/plugin dist/plateau-plugin && zip -r dist/plateau-plugin.zip dist/plateau-plugin
- name: Save artifacts
uses: actions/upload-artifact@v2
if: github.ref == 'refs/heads/main'
with:
name: plateau-plugin
path: plugin/dist/plugin
path: plugin/dist/plateau-plugin.zip

release-nightly:
name: Release nightly/rc
runs-on: ubuntu-latest
needs: [ci-plugin]
if: ${{ github.event.inputs.name != 'blank' }}
env:
ARTIFACT: plateau-plugin_${{ github.event.inputs.name }}
ARTIFACT: plateau-plugin_${{ github.event.inputs.name }}.zip
steps:
- uses: actions/download-artifact@v2
with:
name: plateau-plugin
- name: Rename artifact
run: mv plateau-plugin $ARTIFACT
run: mv plateau-plugin.zip $ARTIFACT
- name: Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: ${{ env.ARTIFACT }}
artifactContentType: application/gzip
artifactContentType: application/zip
commit: ${{ github.event.inputs.sha }}
name: ${{ github.event.inputs.name }}
tag: ${{ github.event.inputs.name }}
Expand All @@ -91,10 +93,10 @@ jobs:
uses: dsaltares/fetch-gh-release-asset@master
with:
version: tags/rc
file: plateau-plugin_rc
file: plateau-plugin_rc.zip
token: ${{ secrets.GITHUB_TOKEN }}
- name: Rename artifact
run: mv plateau-plugin_rc $ARTIFACT
run: mv plateau-plugin_rc.zip $ARTIFACT
- name: Download latest changelog
uses: dawidd6/action-download-artifact@v2
with:
Expand All @@ -105,7 +107,7 @@ jobs:
with:
allowUpdates: true
artifacts: ${{ env.ARTIFACT }}
artifactContentType: application/gzip
artifactContentType: application/zip
commit: ${{ github.event.inputs.sha }}
name: ${{ github.event.inputs.new_tag }}
tag: ${{ github.event.inputs.new_tag }}
Expand Down
2 changes: 1 addition & 1 deletion plugin/zip.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Yml from "yml";
const root = path.resolve("./");

const pluginInfo = Yml.load(`${root}/public/reearth.yml`);
const filename = `${pluginInfo.id}-${pluginInfo.version}.zip`;
const filename = `${pluginInfo.id}.zip`;

const output = fs.createWriteStream(`${root}/dist/${filename}`);
const archive = archiver("zip", { zlib: { level: 9 } });
Expand Down

0 comments on commit 030e72c

Please sign in to comment.