Create build.yml
This commit is contained in:
parent
6a1abc915d
commit
d667d8a578
|
@ -0,0 +1,41 @@
|
|||
name: Build distribution theme
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Build distribution
|
||||
run: |
|
||||
pnpm build
|
||||
- name: Compress zip
|
||||
run: |
|
||||
PACKAGE_VERSION=$(sed -nE 's/^\s*"version": "(.*?)",$/\1/p' package.json)
|
||||
PRE_ZIP_FOLDER=theme-anatole-${PACKAGE_VERSION}
|
||||
ARTIFACT_NAME=${PRE_ZIP_FOLDER}.zip
|
||||
ARTIFACT_PATHNAME=dist/${ARTIFACT_NAME}
|
||||
|
||||
echo "theme-anatole version $PACKAGE_VERSION"
|
||||
echo "Artifact name: ${ARTIFACT_NAME}"
|
||||
echo "Artifact pathname: ${ARTIFACT_PATHNAME}"
|
||||
|
||||
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
|
||||
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
|
||||
echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV
|
||||
echo "RELEASE_ID=${{ github.event.release.id }}" >> $GITHUB_ENV
|
||||
|
||||
mkdir $PRE_ZIP_FOLDER
|
||||
mkdir dist
|
||||
cp -r theme.yaml settings.yaml templates $PRE_ZIP_FOLDER/
|
||||
zip -r $ARTIFACT_PATHNAME $PRE_ZIP_FOLDER
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: theme-hao
|
||||
path: |
|
||||
dist/*.zip
|
||||
retention-days: 7
|
Loading…
Reference in New Issue