diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..86858e6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Releases + +on: + push: + tags: + - 'v*' + +jobs: + + build: + runs-on: ubuntu-latest + env: + HUGO_VERSION: 0.114.0 + permissions: + contents: write + steps: + - name: Install Hugo CLI + run: | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ + && sudo dpkg -i ${{ runner.temp }}/hugo.deb + - uses: actions/checkout@v3 + - name: Install Node.js dependencies + run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" + - name: Build Zip + run: "./build-zip.sh ${{github.ref_name}}" + - uses: ncipollo/release-action@v1 + with: + artifacts: "*.zip" diff --git a/README.md b/README.md index fbe95dc..bb4f345 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,7 @@ Hugo Theme: [Stack](https://github.com/CaiJimmy/hugo-theme-stack) ## App Zip Update ``` -hugo -b / -python3 prepare_native_app.py -rm -rf public/pimg/ -capgo bundle zip --bundle X.X.X +./build-zip.sh 1.X.X ``` Upload zip to Github Release diff --git a/build-zip.sh b/build-zip.sh new file mode 100755 index 0000000..c37f6b6 --- /dev/null +++ b/build-zip.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +tag=$1 + +if [[ $tag = v* ]] +then + tag="${tag:1}" +fi + +hugo -b / +python3 prepare_native_app.py +rm -rf public/pimg/ +capgo bundle zip --bundle $tag