|
| 1 | +on: [push, pull_request] |
| 2 | +name: Upload Release |
| 3 | + |
| 4 | +jobs: |
| 5 | + build: |
| 6 | + name: Build and release |
| 7 | + runs-on: ubuntu-latest |
| 8 | + steps: |
| 9 | + - name: Checkout |
| 10 | + uses: actions/checkout@v1 |
| 11 | + with: |
| 12 | + submodules: true |
| 13 | + |
| 14 | + - name: Add targets |
| 15 | + run: | |
| 16 | + rustup target add thumbv6m-none-eabi |
| 17 | + rustup target add thumbv7m-none-eabihf |
| 18 | +
|
| 19 | + - name: Install flip-link |
| 20 | + run: cd / && cargo install flip-link |
| 21 | + |
| 22 | + - name: Build neotron-bmc-pico |
| 23 | + run: cd neotron-bmc-pico && cargo build --release --verbose --target=thumbv6m-none-eabi |
| 24 | + |
| 25 | + - name: Build neotron-bmc-nucleo |
| 26 | + run: cd neotron-bmc-nucleo && cargo build --release --verbose --target=thumbv7m-none-eabihf |
| 27 | + |
| 28 | + - name: Get Branch Name |
| 29 | + if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/') |
| 30 | + id: branch_name |
| 31 | + run: | |
| 32 | + echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} |
| 33 | +
|
| 34 | + - name: Create Release |
| 35 | + if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/') |
| 36 | + id: create_release |
| 37 | + uses: actions/create-release@v1 |
| 38 | + env: |
| 39 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + with: |
| 41 | + tag_name: ${{ github.ref }} |
| 42 | + release_name: Release ${{ steps.branch_name.outputs.SOURCE_TAG }} |
| 43 | + draft: false |
| 44 | + prerelease: false |
| 45 | + |
| 46 | + - name: Upload files to Release |
| 47 | + if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/') |
| 48 | + uses: softprops/action-gh-release@v1 |
| 49 | + with: |
| 50 | + files: | |
| 51 | + neotron-bmc-pico/target/thumbv6m-none-eabi/release/neotron-bmc |
| 52 | + neotron-bmc-nucleo/target/thumbv7m-none-eabihf/release/neotron-bmc |
| 53 | + env: |
| 54 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments