Skip to content

Commit

Permalink
added package.json to zip files
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Nov 21, 2024
1 parent c15c22a commit eef27e2
Showing 1 changed file with 83 additions and 43 deletions.
126 changes: 83 additions & 43 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Build all and make release on tag
name: mklittlefs for platformio esp32

on:
workflow_dispatch:
push:
tags:
- '*'

pull_request:

jobs:
build-linux:
Expand All @@ -19,32 +18,62 @@ jobs:
- name: Build mklittlefs x86-64
run: |
tgt=linux pfx=x86_64-linux-gnu exe="" AHOST="x86_64-pc-linux-gnu" TARGET_OS=${tgt} CC=${pfx}-gcc CXX=${pfx}-g++ STRIP=${pfx}-strip make clean mklittlefs${exe} BUILD_CONFIG_NAME="-arduino" CPPFLAGS=""
AHOST="x86_64-pc-linux-gnu"
tgt=linux pfx=x86_64-linux-gnu exe="" TARGET_OS=${tgt} CC=${pfx}-gcc CXX=${pfx}-g++ STRIP=${pfx}-strip make clean mklittlefs${exe} BUILD_CONFIG_NAME="-arduino" CPPFLAGS=""
name=mklittlefs-$(git rev-parse --short HEAD)
mkdir -p tmp/mklittlefs
mv mklittlefs tmp/mklittlefs/.
( echo ' {' &&
echo ' "name": "tool-mklittlefs",' &&
echo ' "version": "'$name'",' &&
echo ' "description": "Utility for creating LittleFS images for ESP32x SOCs",' &&
echo ' "keywords": ["tools","build tools","filesystem"],' &&
echo ' "license": "MIT",' &&
echo ' "system": '$AHOST',' &&
echo ' "repository": {"type": "git","url": "https://github.com/ppuc/mklittlefs"}' &&
echo ' }') > tmp/mklittlefs/package.json
cd tmp
zip -rq ../x86_64-linux-gnu-${name}.zip mklittlefs
cd ..
rm -rf tmp
make clean
- name: Build mklittlefs aarch64
run: |
tgt=linux pfx=aarch64-linux-gnu exe="" AHOST="aarch64-linux-gnu" TARGET_OS=${tgt} CC=${pfx}-gcc CXX=${pfx}-g++ STRIP=${pfx}-strip make clean mklittlefs${exe} BUILD_CONFIG_NAME="-arduino" CPPFLAGS=""
AHOST="aarch64-linux-gnu"
tgt=linux pfx=aarch64-linux-gnu exe="" TARGET_OS=${tgt} CC=${pfx}-gcc CXX=${pfx}-g++ STRIP=${pfx}-strip make clean mklittlefs${exe} BUILD_CONFIG_NAME="-arduino" CPPFLAGS=""
name=mklittlefs-$(git rev-parse --short HEAD)
mkdir -p tmp/mklittlefs
mv mklittlefs tmp/mklittlefs/.
( echo ' {' &&
echo ' "name": "tool-mklittlefs",' &&
echo ' "version": "'$name'",' &&
echo ' "description": "Utility for creating LittleFS images for ESP32x SOCs",' &&
echo ' "keywords": ["tools","build tools","filesystem"],' &&
echo ' "license": "MIT",' &&
echo ' "system": '$AHOST',' &&
echo ' "repository": {"type": "git","url": "https://github.com/ppuc/mklittlefs"}' &&
echo ' }') > tmp/mklittlefs/package.json
cd tmp
zip -rq ../aarch64-linux-gnu-${name}.zip mklittlefs
cd ..
rm -rf tmp
make clean
- name: Build mklittlefs arm
run: |
tgt=linux pfx=arm-linux-gnueabihf exe="" AHOST="arm-linux-gnueabihf" TARGET_OS=${tgt} CC=${pfx}-gcc CXX=${pfx}-g++ STRIP=${pfx}-strip make clean mklittlefs${exe} BUILD_CONFIG_NAME="-arduino" CPPFLAGS=""
AHOST="arm-linux-gnueabihf"
tgt=linux pfx=arm-linux-gnueabihf exe="" TARGET_OS=${tgt} CC=${pfx}-gcc CXX=${pfx}-g++ STRIP=${pfx}-strip make clean mklittlefs${exe} BUILD_CONFIG_NAME="-arduino" CPPFLAGS=""
name=mklittlefs-$(git rev-parse --short HEAD)
mkdir -p tmp/mklittlefs
mv mklittlefs tmp/mklittlefs/.
( echo ' {' &&
echo ' "name": "tool-mklittlefs",' &&
echo ' "version": "'$name'",' &&
echo ' "description": "Utility for creating LittleFS images for ESP32x SOCs",' &&
echo ' "keywords": ["tools","build tools","filesystem"],' &&
echo ' "license": "MIT",' &&
echo ' "system": '$AHOST',' &&
echo ' "repository": {"type": "git","url": "https://github.com/ppuc/mklittlefs"}' &&
echo ' }') > tmp/mklittlefs/package.json
cd tmp
zip -rq ../arm-linux-gnueabihf-${name}.zip mklittlefs
cd ..
Expand All @@ -54,17 +83,17 @@ jobs:
- name: Upload mklittlefs x86-64
uses: actions/upload-artifact@v4
with:
name: x86_64-linux-gnu-mklittlefs.zip
name: x86_64-linux-gnu-mklittlefs
path: x86_64-linux-gnu-mklittlefs-*.zip
- name: Upload mklittlefs aarch64
uses: actions/upload-artifact@v4
with:
name: aarch64-linux-gnu-mklittlefs.zip
name: aarch64-linux-gnu-mklittlefs
path: aarch64-linux-gnu-mklittlefs-*.zip
- name: Upload mklittlefs arm-linux-gnueabihf
uses: actions/upload-artifact@v4
with:
name: arm-linux-gnueabihf-mklittlefs.zip
name: arm-linux-gnueabihf-mklittlefs
path: arm-linux-gnueabihf-mklittlefs-*.zip

build-mac-arm:
Expand All @@ -81,20 +110,30 @@ jobs:
run: |
rm -f *.json *.gz *.zip
pfx=aarch64-apple-darwin20
AHOST=aarch64-apple-darwin TARGET_OS=osx CC=gcc CXX=g++ STRIP=strip make clean mklittlefs BUILD_CONFIG_NAME="-arduino" CPPFLAGS=""
AHOST=aarch64-apple-darwin
TARGET_OS=osx CC=gcc CXX=g++ STRIP=strip make clean mklittlefs BUILD_CONFIG_NAME="-arduino" CPPFLAGS=""
- name: Package mklittlefs MacARM
run: |
name=mklittlefs-$(git rev-parse --short HEAD)
mkdir -p tmp/mklittlefs
mv mklittlefs tmp/mklittlefs/.
( echo ' {' &&
echo ' "name": "tool-mklittlefs",' &&
echo ' "version": "'$name'",' &&
echo ' "description": "Utility for creating LittleFS images for ESP32x SOCs",' &&
echo ' "keywords": ["tools","build tools","filesystem"],' &&
echo ' "license": "MIT",' &&
echo ' "system": '$AHOST',' &&
echo ' "repository": {"type": "git","url": "https://github.com/ppuc/mklittlefs"}' &&
echo ' }') > tmp/mklittlefs/package.json
cd tmp
zip -rq ../aarch64-apple-darwin-${name}.zip mklittlefs
cd ..
rm -rf tmp
- name: Upload mklittlefs MacARM
uses: actions/upload-artifact@v4
with:
name: aarch64-apple-darwin-mklittlefs.zip
name: aarch64-apple-darwin-mklittlefs
path: aarch64-apple-darwin-mklittlefs-*.zip

build-mac:
Expand All @@ -111,20 +150,30 @@ jobs:
run: |
rm -f *.json *.gz *.zip
pfx=x86_64-apple-darwin20
AHOST=x86_64-apple-darwin TARGET_OS=osx CC=gcc CXX=g++ STRIP=strip make clean mklittlefs BUILD_CONFIG_NAME="-arduino" CPPFLAGS=""
AHOST=x86_64-apple-darwin
TARGET_OS=osx CC=gcc CXX=g++ STRIP=strip make clean mklittlefs BUILD_CONFIG_NAME="-arduino" CPPFLAGS=""
- name: Package mklittlefs Mac86
run: |
name=mklittlefs-$(git rev-parse --short HEAD)
mkdir -p tmp/mklittlefs
mv mklittlefs tmp/mklittlefs/.
( echo ' {' &&
echo ' "name": "tool-mklittlefs",' &&
echo ' "version": "'$name'",' &&
echo ' "description": "Utility for creating LittleFS images for ESP32x SOCs",' &&
echo ' "keywords": ["tools","build tools","filesystem"],' &&
echo ' "license": "MIT",' &&
echo ' "system": '$AHOST',' &&
echo ' "repository": {"type": "git","url": "https://github.com/ppuc/mklittlefs"}' &&
echo ' }') > tmp/mklittlefs/package.json
cd tmp
zip -rq ../x86_64-apple-darwin-${name}.zip mklittlefs
cd ..
rm -rf tmp
- name: Upload mklittlefs Mac86
uses: actions/upload-artifact@v4
with:
name: x86_64-apple-darwin-mklittlefs.zip
name: x86_64-apple-darwin-mklittlefs
path: x86_64-apple-darwin-mklittlefs-*.zip

build-windows:
Expand All @@ -149,12 +198,22 @@ jobs:
run: |
rm -f *.json *.gz *.zip
pfx=${{matrix.env}}-w64-mingw32
AHOST=${{matrix.env}}-mingw32 TARGET_OS=windows CC=${pfx}-gcc CXX=${pfx}-g++ STRIP=strip mingw32-make clean mklittlefs.exe BUILD_CONFIG_NAME="-arduino" CPPFLAGS=""
AHOST=${{matrix.env}}-mingw32
TARGET_OS=windows CC=${pfx}-gcc CXX=${pfx}-g++ STRIP=strip mingw32-make clean mklittlefs.exe BUILD_CONFIG_NAME="-arduino" CPPFLAGS=""
- name: Package mklittlefs ${{matrix.env}}
run: |
name=mklittlefs-$(git rev-parse --short HEAD)
mkdir -p tmp/mklittlefs
mv mklittlefs.exe tmp/mklittlefs/.
( echo ' {' &&
echo ' "name": "tool-mklittlefs",' &&
echo ' "version": "'$name'",' &&
echo ' "description": "Utility for creating LittleFS images for ESP32x SOCs",' &&
echo ' "keywords": ["tools","build tools","filesystem"],' &&
echo ' "license": "MIT",' &&
echo ' "system": '$AHOST',' &&
echo ' "repository": {"type": "git","url": "https://github.com/ppuc/mklittlefs"}' &&
echo ' }') > tmp/mklittlefs/package.json
cp /mingw*/bin/libwinpthread*.dll tmp/mklittlefs/.
cd tmp
zip -rq ../${{matrix.env}}-w64-mingw32-${name}.zip mklittlefs
Expand All @@ -163,37 +222,18 @@ jobs:
- name: Upload mklittlefs ${{matrix.env}}
uses: actions/upload-artifact@v4
with:
name: ${{matrix.env}}-w64-mingw32-mklittlefs.zip
name: ${{matrix.env}}-w64-mingw32-mklittlefs
path: ${{matrix.env}}-w64-mingw32-mklittlefs-*.zip

make-release:
needs: [build-linux, build-mac-arm, build-mac, build-windows]
runs-on: ubuntu-latest
permissions:
contents: write
name: Release
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: .
- name: Renaming artifacts
run: |
rev=$(git rev-parse --short HEAD)
mkdir release
mkdir tmp && cd tmp && unzip ../x86_64-apple-darwin-mklittlefs.zip/*zip && tar zcvf ../release/x86_64-apple-darwin-mklittlefs-${rev}.tar.gz mklittlefs && cd .. && rm -rf tmp
mkdir tmp && cd tmp && unzip ../aarch64-apple-darwin-mklittlefs.zip/*zip && tar zcvf ../release/aarch64-apple-darwin-mklittlefs-${rev}.tar.gz mklittlefs && cd .. && rm -rf tmp
mv i686-w64-mingw32-mklittlefs.zip/*zip ./release/i686-w64-mingw32-mklittlefs-${rev}.zip
mv x86_64-w64-mingw32-mklittlefs.zip/*zip ./release/x86_64-w64-mingw32-mklittlefs-${rev}.zip
mkdir tmp && cd tmp && unzip ../x86_64-linux-gnu-mklittlefs.zip/*zip && tar zcvf ../release/x86_64-linux-gnu-mklittlefs-${rev}.tar.gz mklittlefs && cd .. && rm -rf tmp
mkdir tmp && cd tmp && unzip ../aarch64-linux-gnu-mklittlefs.zip/*zip && tar zcvf ../release/aarch64-linux-gnu-mklittlefs-${rev}.tar.gz mklittlefs && cd .. && rm -rf tmp
mkdir tmp && cd tmp && unzip ../arm-linux-gnueabihf-mklittlefs.zip/*zip && tar zcvf ../release/arm-linux-gnueabihf-mklittlefs-${rev}.tar.gz mklittlefs && cd .. && rm -rf tmp
ls -l release
- name: Drafting release
uses: ncipollo/release-action@v1
with:
artifacts: "release/*"
draft: true
generateReleaseNotes: true
- uses: actions/download-artifact@v4
- name: Assets
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: */*.zip

0 comments on commit eef27e2

Please sign in to comment.