|
| 1 | +# Copyright (c) 2022 Arm Limited. All rights reserved. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +name: Publish CMSIS-pack example project zip file |
| 17 | + |
| 18 | +on: |
| 19 | + workflow_dispatch: |
| 20 | + push: |
| 21 | + branches: |
| 22 | + - main |
| 23 | + paths: |
| 24 | + - cmsis-pack-examples/** |
| 25 | + |
| 26 | +jobs: |
| 27 | + zip-files: |
| 28 | + runs-on: ubuntu-latest |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v2 |
| 31 | + - uses: vimtor/action-zip@v1 |
| 32 | + with: |
| 33 | + files: cmsis-pack-examples/ |
| 34 | + recursive: true |
| 35 | + dest: cmsis-pack-examples.zip |
| 36 | + - name: Create Release |
| 37 | + id: create_release |
| 38 | + uses: actions/create-release@v1 |
| 39 | + env: |
| 40 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 41 | + with: |
| 42 | + tag_name: ${{ github.run_id }} |
| 43 | + release_name: Release ${{ github.run_id }} |
| 44 | + body: | |
| 45 | + CMSIS example packs release |
| 46 | + prerelease: false |
| 47 | + draft: false |
| 48 | + - name: Upload Release Asset |
| 49 | + id: upload-release-asset |
| 50 | + uses: actions/upload-release-asset@v1 |
| 51 | + env: |
| 52 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + with: |
| 54 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 55 | + asset_path: ${{ github.workspace }}/cmsis-pack-examples.zip |
| 56 | + asset_name: cmsis-pack-examples.zip |
| 57 | + asset_content_type: application/zip |
0 commit comments