|
| 1 | +on: |
| 2 | + push: |
| 3 | + tags: |
| 4 | + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 |
| 5 | + |
| 6 | +name: Upload Release |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + name: Upload Release |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout code |
| 14 | + uses: actions/checkout@v2 |
| 15 | + with: |
| 16 | + submodules: recursive |
| 17 | + - name: Get Branch Name |
| 18 | + id: branch_name |
| 19 | + run: | |
| 20 | + echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/} |
| 21 | + echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/} |
| 22 | + echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} |
| 23 | + - name: Set version number |
| 24 | + env: |
| 25 | + SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} |
| 26 | + run: | |
| 27 | + sed -i "s~\[Uncontrolled\]~${SOURCE_TAG}~g" Kicad/*.sch Kicad/*.kicad_pcb |
| 28 | + - name: Build project |
| 29 | + uses: nerdyscout/kicad-exports@v2.3 |
| 30 | + with: |
| 31 | + config: 'Kicad/docs.kibot.yaml' |
| 32 | + dir: docs |
| 33 | + schema: 'Kicad/Neotron-Expansion-Template.sch' |
| 34 | + board: 'Kicad/Neotron-Expansion-Template.kicad_pcb' |
| 35 | + - name: Create Release |
| 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 | + - name: Build gerbers zip file |
| 46 | + env: |
| 47 | + SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} |
| 48 | + run: | |
| 49 | + zip -r --junk-paths neotron-expansion-template-gerbers-${SOURCE_TAG}.zip docs/gerbers/ |
| 50 | + - name: Upload files to Release |
| 51 | + uses: softprops/action-gh-release@v1 |
| 52 | + with: |
| 53 | + files: | |
| 54 | + neotron-expansion-template-gerbers-*.zip |
| 55 | + docs/* |
| 56 | + env: |
| 57 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments