|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + - master |
| 7 | + tags: |
| 8 | + - 'v*' |
| 9 | + pull_request: |
| 10 | + |
| 11 | +jobs: |
| 12 | + archive-example-1: |
| 13 | + name: Archive Example 1 Ckt |
| 14 | + runs-on: ubuntu-latest |
| 15 | + env: |
| 16 | + REPO_NAME: ${{ github.event.repository.name }} |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v2 |
| 20 | + with: |
| 21 | + ref: example1 |
| 22 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 23 | + - name: Archive |
| 24 | + run: | |
| 25 | + shopt -s globstar |
| 26 | + tar -cvf manual-example1.ckt **/*.csv README LICENSE |
| 27 | + - name: Upload archive |
| 28 | + uses: actions/upload-artifact@v4 |
| 29 | + with: |
| 30 | + name: ckt-example1 |
| 31 | + path: manual-example1.ckt |
| 32 | + archive-example-2: |
| 33 | + name: Archive Example 2 Ckt |
| 34 | + runs-on: ubuntu-latest |
| 35 | + env: |
| 36 | + REPO_NAME: ${{ github.event.repository.name }} |
| 37 | + steps: |
| 38 | + - name: Checkout |
| 39 | + uses: actions/checkout@v2 |
| 40 | + with: |
| 41 | + ref: example2 |
| 42 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 43 | + - name: Archive |
| 44 | + run: tar -cvf manual-example2.ckt *.csv README LICENSE |
| 45 | + - name: Upload archive |
| 46 | + uses: actions/upload-artifact@v4 |
| 47 | + with: |
| 48 | + name: ckt-example2 |
| 49 | + path: manual-example2.ckt |
| 50 | + |
| 51 | + release: |
| 52 | + name: Release |
| 53 | + runs-on: ubuntu-latest |
| 54 | + if: "startsWith(github.ref, 'refs/tags/')" |
| 55 | + permissions: write-all |
| 56 | + needs: [ archive-example-1, archive-example-2 ] |
| 57 | + steps: |
| 58 | + - uses: actions/download-artifact@v4 |
| 59 | + with: |
| 60 | + name: ckt-example1 |
| 61 | + - uses: actions/download-artifact@v4 |
| 62 | + with: |
| 63 | + name: ckt-example2 |
| 64 | + |
| 65 | + - name: Release |
| 66 | + uses: actions/create-release@v1 |
| 67 | + id: create_release |
| 68 | + with: |
| 69 | + tag_name: ${{ github.ref }} |
| 70 | + release_name: Release ${{ github.ref }} |
| 71 | + env: |
| 72 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 73 | + |
| 74 | + - name: Upload Example 1 Ckt artifact |
| 75 | + uses: actions/upload-release-asset@v1 |
| 76 | + env: |
| 77 | + GITHUB_TOKEN: ${{ github.token }} |
| 78 | + with: |
| 79 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 80 | + asset_path: ./manual-example1.ckt |
| 81 | + asset_name: manual-example1-${{ github.ref_name }}.ckt |
| 82 | + asset_content_type: application/x-tar |
| 83 | + |
| 84 | + - name: Upload Example 2 Ckt artifact |
| 85 | + uses: actions/upload-release-asset@v1 |
| 86 | + env: |
| 87 | + GITHUB_TOKEN: ${{ github.token }} |
| 88 | + with: |
| 89 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 90 | + asset_path: ./manual-example2.ckt |
| 91 | + asset_name: manual-example2-${{ github.ref_name }}.ckt |
| 92 | + asset_content_type: application/x-tar |
0 commit comments