|
| 1 | +name: Pipeline |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + unit-test: |
| 11 | + name: Unit Test |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Check out repository |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Run unit tests |
| 19 | + run: make unit-test |
| 20 | + |
| 21 | + smoke-test: |
| 22 | + name: Smoke Test |
| 23 | + runs-on: ubuntu-latest |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: Check out repository |
| 27 | + uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: Set up Python |
| 30 | + uses: actions/setup-python@v5 |
| 31 | + with: |
| 32 | + python-version: "3.13" |
| 33 | + |
| 34 | + - name: Run smoke tests |
| 35 | + run: make smoke-test |
| 36 | + |
| 37 | + package-buildpack: |
| 38 | + name: Package Buildpack |
| 39 | + runs-on: ubuntu-latest |
| 40 | + needs: |
| 41 | + - unit-test |
| 42 | + - smoke-test |
| 43 | + |
| 44 | + steps: |
| 45 | + - name: Check out repository |
| 46 | + uses: actions/checkout@v4 |
| 47 | + with: |
| 48 | + fetch-depth: 0 |
| 49 | + |
| 50 | + - name: Set up Go |
| 51 | + uses: actions/setup-go@v5 |
| 52 | + with: |
| 53 | + go-version: "1.22" |
| 54 | + |
| 55 | + - name: Install buildpack-packager |
| 56 | + run: go install github.com/cloudfoundry/libbuildpack/packager/buildpack-packager@latest |
| 57 | + |
| 58 | + - name: Package buildpack |
| 59 | + run: buildpack-packager build -cached -any-stack |
| 60 | + |
| 61 | + - name: Upload packaged buildpack |
| 62 | + if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 63 | + uses: actions/upload-artifact@v4 |
| 64 | + with: |
| 65 | + name: packaged-buildpack |
| 66 | + path: "*.zip" |
| 67 | + if-no-files-found: error |
| 68 | + |
| 69 | + release-buildpack: |
| 70 | + name: Release Buildpack |
| 71 | + runs-on: ubuntu-latest |
| 72 | + if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 73 | + needs: |
| 74 | + - package-buildpack |
| 75 | + permissions: |
| 76 | + contents: write |
| 77 | + issues: write |
| 78 | + pull-requests: write |
| 79 | + |
| 80 | + steps: |
| 81 | + - name: Check out repository |
| 82 | + uses: actions/checkout@v4 |
| 83 | + with: |
| 84 | + fetch-depth: 0 |
| 85 | + |
| 86 | + - name: Download packaged buildpack |
| 87 | + uses: actions/download-artifact@v4 |
| 88 | + with: |
| 89 | + name: packaged-buildpack |
| 90 | + |
| 91 | + - name: Set up Node.js |
| 92 | + uses: actions/setup-node@v4 |
| 93 | + with: |
| 94 | + node-version: "22" |
| 95 | + |
| 96 | + - name: Install semantic-release |
| 97 | + run: npm install --no-save semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/github conventional-changelog-conventionalcommits |
| 98 | + |
| 99 | + - name: Publish semantic release |
| 100 | + env: |
| 101 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 102 | + run: npx semantic-release |
0 commit comments