Removed installer creation #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: toolbox | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/toolbox.yml' | |
- '**' | |
pull_request: | |
paths: | |
- '.github/workflows/toolbox.yml' | |
- '**' | |
release: | |
types: [published] | |
jobs: | |
create_archives: | |
if: | | |
${{ github.event_name == 'pull_request' || github.event_name == 'release' }} | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout devtools | |
uses: actions/checkout@v2 | |
- name: Create folders | |
run: | | |
mkdir -p toolbox/cbuild | |
mkdir -p toolbox/packchk | |
mkdir -p toolbox/svdconv | |
mkdir -p toolbox/distribution/bin | |
mkdir -p toolbox/distribution/etc | |
mkdir -p toolbox/distribution/doc | |
- name: Download cbuild release asset | |
uses: dsaltares/fetch-gh-release-asset@master | |
with: | |
repo: "Open-CMSIS-Pack/devtools" | |
version: tags/tools/buildmgr/2.0.0 | |
file: cbuild_install.sh | |
target: toolbox/cbuild/cbuild_install.sh | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Download packchk release assets | |
uses: dsaltares/fetch-gh-release-asset@master | |
with: | |
repo: "Open-CMSIS-Pack/devtools" | |
version: tags/tools/packchk/1.4.1 | |
regex: true | |
file: "packchk-.*\\.(zip|tbz2)" | |
target: "toolbox/packchk/" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Download svdconv release assets | |
uses: dsaltares/fetch-gh-release-asset@master | |
with: | |
repo: "Open-CMSIS-Pack/devtools" | |
version: tags/tools/svdconv/3.3.45 | |
regex: true | |
file: "svdconv-.*\\.(zip|tbz2)" | |
target: "toolbox/svdconv/" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Unzip and copy files | |
run: | | |
curl https://raw.githubusercontent.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/v1.7.25/schema/PACK.xsd --output distribution/etc/PACK.xsd | |
sudo chmod +x ./cbuild/cbuild_install.sh | |
./cbuild/cbuild_install.sh -x cbuild | |
cp -r cbuild/bin/* distribution/bin | |
cp -r cbuild/etc/* distribution/etc | |
tar -xvf packchk/packchk-*-darwin-amd64.tbz2 -C packchk && mv packchk/packchk distribution/bin/packchk.mac-amd64 | |
tar -xvf packchk/packchk-*-darwin-arm64.tbz2 -C packchk && mv packchk/packchk distribution/bin/packchk.mac-arm64 | |
tar -xvf packchk/packchk-*-linux-amd64.tbz2 -C packchk && mv packchk/packchk distribution/bin/packchk.lin-amd64 | |
tar -xvf packchk/packchk-*-linux-arm64.tbz2 -C packchk && mv packchk/packchk distribution/bin/packchk.lin-arm64 | |
unzip packchk/packchk-\*-windows-amd64.zip -d packchk && mv packchk/packchk.exe distribution/bin/packchk.exe-amd64 | |
unzip packchk/packchk-\*-windows-arm64.zip -d packchk && mv packchk/packchk.exe distribution/bin/packchk.exe-arm64 | |
tar -xvf svdconv/svdconv-*-darwin-amd64.tbz2 -C svdconv && mv svdconv/svdconv distribution/bin/svdconv.mac-amd64 | |
tar -xvf svdconv/svdconv-*-darwin-arm64.tbz2 -C svdconv && mv svdconv/svdconv distribution/bin/svdconv.mac-arm64 | |
tar -xvf svdconv/svdconv-*-linux-amd64.tbz2 -C svdconv && mv svdconv/svdconv distribution/bin/svdconv.lin-amd64 | |
tar -xvf svdconv/svdconv-*-linux-arm64.tbz2 -C svdconv && mv svdconv/svdconv distribution/bin/svdconv.lin-arm64 | |
unzip svdconv/svdconv-\*-windows-amd64.zip -d svdconv && mv svdconv/svdconv.exe distribution/bin/svdconv.exe-amd64 | |
unzip svdconv/svdconv-\*-windows-arm64.zip -d svdconv && mv svdconv/svdconv.exe distribution/bin/svdconv.exe-arm64 | |
cp ../docs/LICENSE.txt distribution | |
cp ../docs/index.html distribution/doc | |
working-directory: toolbox | |
- name: Add execution permission to the binaries and set files ownership | |
run: | | |
sudo chmod -R +x bin/* | |
sudo chown -R root:root * | |
working-directory: toolbox/distribution | |
- name: Copy files separated by target for archiving | |
run: | | |
mkdir -p zip/cmsis-toolbox-windows-amd64/bin zip/cmsis-toolbox-windows-amd64/etc zip/cmsis-toolbox-windows-amd64/doc | |
mkdir -p zip/cmsis-toolbox-windows-arm64/bin zip/cmsis-toolbox-windows-arm64/etc zip/cmsis-toolbox-windows-arm64/doc | |
mkdir -p zip/cmsis-toolbox-linux-amd64/bin zip/cmsis-toolbox-linux-amd64/etc zip/cmsis-toolbox-linux-amd64/doc | |
mkdir -p zip/cmsis-toolbox-linux-arm64/bin zip/cmsis-toolbox-linux-arm64/etc zip/cmsis-toolbox-linux-arm64/doc | |
mkdir -p zip/cmsis-toolbox-darwin-amd64/bin zip/cmsis-toolbox-darwin-amd64/etc zip/cmsis-toolbox-darwin-amd64/doc | |
mkdir -p zip/cmsis-toolbox-darwin-arm64/bin zip/cmsis-toolbox-darwin-arm64/etc zip/cmsis-toolbox-darwin-arm64/doc | |
cp distribution/bin/cbuild.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/cbuild.exe | |
cp distribution/bin/cbuildgen.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/cbuildgen.exe | |
cp distribution/bin/cpackget.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/cpackget.exe | |
cp distribution/bin/csolution.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/csolution.exe | |
cp distribution/bin/packchk.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/packchk.exe | |
cp distribution/bin/svdconv.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/svdconv.exe | |
cp distribution/bin/cbuild.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/cbuild.exe | |
cp distribution/bin/cbuildgen.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/cbuildgen.exe | |
cp distribution/bin/cpackget.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/cpackget.exe | |
cp distribution/bin/csolution.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/csolution.exe | |
cp distribution/bin/packchk.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/packchk.exe | |
cp distribution/bin/svdconv.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/svdconv.exe | |
cp distribution/bin/cbuild.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/cbuild | |
cp distribution/bin/cbuildgen.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/cbuildgen | |
cp distribution/bin/cpackget.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/cpackget | |
cp distribution/bin/csolution.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/csolution | |
cp distribution/bin/packchk.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/packchk | |
cp distribution/bin/svdconv.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/svdconv | |
cp distribution/bin/cbuild.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/cbuild | |
cp distribution/bin/cbuildgen.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/cbuildgen | |
cp distribution/bin/cpackget.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/cpackget | |
cp distribution/bin/csolution.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/csolution | |
cp distribution/bin/packchk.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/packchk | |
cp distribution/bin/svdconv.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/svdconv | |
cp distribution/bin/cbuild.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/cbuild | |
cp distribution/bin/cbuildgen.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/cbuildgen | |
cp distribution/bin/cpackget.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/cpackget | |
cp distribution/bin/csolution.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/csolution | |
cp distribution/bin/packchk.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/packchk | |
cp distribution/bin/svdconv.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/svdconv | |
cp distribution/bin/cbuild.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/cbuild | |
cp distribution/bin/cbuildgen.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/cbuildgen | |
cp distribution/bin/cpackget.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/cpackget | |
cp distribution/bin/csolution.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/csolution | |
cp distribution/bin/packchk.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/packchk | |
cp distribution/bin/svdconv.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/svdconv | |
cp distribution/LICENSE.txt zip/cmsis-toolbox-windows-amd64/LICENSE.txt | |
cp distribution/LICENSE.txt zip/cmsis-toolbox-windows-arm64/LICENSE.txt | |
cp distribution/LICENSE.txt zip/cmsis-toolbox-linux-amd64/LICENSE.txt | |
cp distribution/LICENSE.txt zip/cmsis-toolbox-linux-arm64/LICENSE.txt | |
cp distribution/LICENSE.txt zip/cmsis-toolbox-darwin-amd64/LICENSE.txt | |
cp distribution/LICENSE.txt zip/cmsis-toolbox-darwin-arm64/LICENSE.txt | |
rm distribution/etc/setup | |
cp -r distribution/etc/* zip/cmsis-toolbox-windows-amd64/etc | |
cp -r distribution/etc/* zip/cmsis-toolbox-windows-arm64/etc | |
cp -r distribution/etc/* zip/cmsis-toolbox-linux-amd64/etc | |
cp -r distribution/etc/* zip/cmsis-toolbox-linux-arm64/etc | |
cp -r distribution/etc/* zip/cmsis-toolbox-darwin-amd64/etc | |
cp -r distribution/etc/* zip/cmsis-toolbox-darwin-arm64/etc | |
cp -r distribution/doc/* zip/cmsis-toolbox-windows-amd64/doc | |
cp -r distribution/doc/* zip/cmsis-toolbox-windows-arm64/doc | |
cp -r distribution/doc/* zip/cmsis-toolbox-linux-amd64/doc | |
cp -r distribution/doc/* zip/cmsis-toolbox-linux-arm64/doc | |
cp -r distribution/doc/* zip/cmsis-toolbox-darwin-amd64/doc | |
cp -r distribution/doc/* zip/cmsis-toolbox-darwin-arm64/doc | |
working-directory: toolbox | |
- name: Set toolchain default paths | |
run: | | |
./scripts/set-default.sh Windows toolbox/zip/cmsis-toolbox-windows-amd64/etc | |
./scripts/set-default.sh Windows toolbox/zip/cmsis-toolbox-windows-arm64/etc | |
./scripts/set-default.sh Linux toolbox/zip/cmsis-toolbox-linux-amd64/etc | |
./scripts/set-default.sh Linux toolbox/zip/cmsis-toolbox-linux-arm64/etc | |
./scripts/set-default.sh Darwin toolbox/zip/cmsis-toolbox-darwin-amd64/etc | |
./scripts/set-default.sh Darwin toolbox/zip/cmsis-toolbox-darwin-arm64/etc | |
- name: Zip folders | |
run: | | |
zip -r cmsis-toolbox-windows-amd64.zip cmsis-toolbox-windows-amd64 | |
zip -r cmsis-toolbox-windows-arm64.zip cmsis-toolbox-windows-arm64 | |
tar -czvf cmsis-toolbox-linux-amd64.tar.gz cmsis-toolbox-linux-amd64 | |
tar -czvf cmsis-toolbox-linux-arm64.tar.gz cmsis-toolbox-linux-arm64 | |
tar -czvf cmsis-toolbox-darwin-amd64.tar.gz cmsis-toolbox-darwin-amd64 | |
tar -czvf cmsis-toolbox-darwin-arm64.tar.gz cmsis-toolbox-darwin-arm64 | |
working-directory: toolbox/zip | |
- name: Archive windows amd64 binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cmsis-toolbox-windows-amd64 | |
path: ./toolbox/zip/cmsis-toolbox-windows-amd64.zip | |
retention-days: 1 | |
if-no-files-found: error | |
- name: Archive windows arm64 binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cmsis-toolbox-windows-arm64 | |
path: ./toolbox/zip/cmsis-toolbox-windows-arm64.zip | |
retention-days: 1 | |
if-no-files-found: error | |
- name: Archive linux amd64 binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cmsis-toolbox-linux-amd64 | |
path: ./toolbox/zip/cmsis-toolbox-linux-amd64.tar.gz | |
retention-days: 1 | |
if-no-files-found: error | |
- name: Archive linux arm64 binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cmsis-toolbox-linux-arm64 | |
path: ./toolbox/zip/cmsis-toolbox-linux-arm64.tar.gz | |
retention-days: 1 | |
if-no-files-found: error | |
- name: Archive darwin amd64 binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cmsis-toolbox-darwin-amd64 | |
path: ./toolbox/zip/cmsis-toolbox-darwin-amd64.tar.gz | |
retention-days: 1 | |
if-no-files-found: error | |
- name: Archive darwin arm64 binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cmsis-toolbox-darwin-arm64 | |
path: ./toolbox/zip/cmsis-toolbox-darwin-arm64.tar.gz | |
retention-days: 1 | |
if-no-files-found: error | |
tests: | |
if: | | |
${{ github.event_name == 'pull_request' || github.event_name == 'release' }} | |
needs: [ create_archives ] | |
timeout-minutes: 15 | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
config: | |
- { os: macos-12, target: darwin, arch: amd64 } | |
- { os: macos-12, target: darwin, arch: arm64 } | |
- { os: windows-2019, target: windows, arch: amd64} | |
- { os: windows-2019, target: windows, arch: arm64} | |
- { os: ubuntu-20.04, target: linux, arch: amd64} | |
- { os: ubuntu-20.04, target: linux, arch: arm64} | |
steps: | |
- name: Checkout cmsis-toolbox | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Download cmsis toolbox ${{ matrix.config.target }} ${{ matrix.config.arch }} | |
uses: actions/download-artifact@v2 | |
with: | |
name: cmsis-toolbox-${{ matrix.config.target }}-${{ matrix.config.arch }} | |
path: archive | |
- name: unzip cmsis-toolbox windows archive | |
if: ${{ startsWith(matrix.config.os, 'windows') }} | |
run: unzip archive/cmsis-toolbox-${{ matrix.config.target }}-${{ matrix.config.arch }}.zip -d toolbox | |
- name: unzip cmsis-toolbox macos/linux archive | |
if: ${{ startsWith(matrix.config.os, 'macos') || startsWith(matrix.config.os, 'ubuntu') }} | |
run: tar -xvf archive/cmsis-toolbox-${{ matrix.config.target }}-${{ matrix.config.arch }}.tar.gz -C toolbox | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
- name: Test with pytest | |
run: | | |
pytest test/tests.py -rA --junitxml=test-results-${{ matrix.config.target }}-${{ matrix.config.arch }}.xml | |
- name: Archive test report | |
uses: actions/upload-artifact@v2 | |
with: | |
name: toolbox_test-${{ matrix.config.target }}-${{ matrix.config.arch }} | |
path: ./test-results-*.xml | |
retention-days: 1 | |
if-no-files-found: error | |
- name: Publish Toolbox Test Results | |
uses: mikepenz/action-junit-report@v2 | |
with: | |
check_name: toolbox_test-${{ matrix.config.target }}-${{ matrix.config.arch }} | |
report_paths: test-results-${{ matrix.config.target }}-${{ matrix.config.arch }}.xml | |
release: | |
if: ${{ github.event_name == 'release' }} | |
needs: [ create_archives ] | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 15 | |
steps: | |
- name: Download cmsis toolbox windows amd64 zip | |
uses: actions/download-artifact@v2 | |
with: | |
name: cmsis-toolbox-windows-amd64 | |
path: toolbox/zip | |
- name: Download cmsis toolbox windows arm64 zip | |
uses: actions/download-artifact@v2 | |
with: | |
name: cmsis-toolbox-windows-arm64 | |
path: toolbox/zip | |
- name: Download cmsis toolbox linux amd64 zip | |
uses: actions/download-artifact@v2 | |
with: | |
name: cmsis-toolbox-linux-amd64 | |
path: toolbox/zip | |
- name: Download cmsis toolbox linux arm64 zip | |
uses: actions/download-artifact@v2 | |
with: | |
name: cmsis-toolbox-linux-arm64 | |
path: toolbox/zip | |
- name: Download cmsis toolbox darwin amd64 zip | |
uses: actions/download-artifact@v2 | |
with: | |
name: cmsis-toolbox-darwin-amd64 | |
path: toolbox/zip | |
- name: Calculate checksums | |
run: | | |
sha256sum cmsis-toolbox-windows-amd64.zip --text > cmsis-toolbox-checksums.txt | |
sha256sum cmsis-toolbox-windows-arm64.zip --text >> cmsis-toolbox-checksums.txt | |
sha256sum cmsis-toolbox-linux-amd64.tar.gz --text >> cmsis-toolbox-checksums.txt | |
sha256sum cmsis-toolbox-linux-arm64.tar.gz --text >> cmsis-toolbox-checksums.txt | |
sha256sum cmsis-toolbox-darwin-amd64.tar.gz --text >> cmsis-toolbox-checksums.txt | |
sha256sum cmsis-toolbox-darwin-arm64.tar.gz --text >> cmsis-toolbox-checksums.txt | |
working-directory: toolbox/zip | |
- name: Attach installer to release assets | |
id: release_assets | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: toolbox/zip/cmsis-toolbox-* | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true |