Skip to content

Create Archive

Create Archive #48

Workflow file for this run

# http://skawashima.com/blog/2019/12/github-actions-auto-release/
# https://qiita.com/hotpepsi/items/756bf03812af66fdeb8c
# https://github.com/marketplace/actions/zip-release
# https://docs.github.com/ja/actions/using-workflows/workflow-syntax-for-github-actions
# https://github.com/softprops/action-gh-release
name: Create Archive
on:
release:
types: [published]
jobs:
build:
name: Create Archive Job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create zip file
run: zip kicad-addon metadata.json -r plugins -r resources
- name: Upload assets
id: upload-assets
uses: softprops/action-gh-release@v1
with:
files: kicad-addon.zip
- name: Put zip info to Release.txt
run: |
echo "\`\`\`json" >> Release.txt
echo "{" >> Release.txt
echo " \"download_size\": $(stat --printf=%s kicad-addon.zip)," >> Release.txt
echo " \"download_sha256\": \"$(sha256sum kicad-addon.zip | cut -d ' ' -f 1)\"," >> Release.txt
echo " \"download_url\": \"${{ fromJSON(steps.upload-assets.outputs.assets)[0].browser_download_url }}\"," >> Release.txt
echo " \"install_size\": $([[ "$(zipinfo -t kicad-addon.zip)" =~ ^[0-9]+\ files,\ ([0-9]+)\ bytes.*$ ]]; echo ${BASH_REMATCH[1]})" >> Release.txt
echo "}" >> Release.txt
echo "\`\`\`" >> Release.txt
- name: Update body of release
uses: softprops/action-gh-release@v1
with:
append_body: true
body_path: Release.txt