|
| 1 | +name: Create or Update Draft Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + repository_dispatch: |
| 8 | + types: [ version-bump ] |
| 9 | + workflow_dispatch: {} |
| 10 | + |
| 11 | +jobs: |
| 12 | + unit: |
| 13 | + name: Unit Tests |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - name: Setup Go |
| 17 | + uses: actions/setup-go@v1 |
| 18 | + with: |
| 19 | + go-version: 1.16 |
| 20 | + - name: Checkout |
| 21 | + uses: actions/checkout@v2 |
| 22 | + - name: Run Unit Tests |
| 23 | + run: ./scripts/unit.sh |
| 24 | + |
| 25 | + integration: |
| 26 | + name: Integration Tests |
| 27 | + runs-on: ubuntu-latest |
| 28 | + needs: unit |
| 29 | + steps: |
| 30 | + - name: Setup Go |
| 31 | + uses: actions/setup-go@v1 |
| 32 | + with: |
| 33 | + go-version: 1.16 |
| 34 | + - name: Checkout |
| 35 | + uses: actions/checkout@v2 |
| 36 | + - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true |
| 37 | + - name: Run Integration Tests |
| 38 | + run: ./scripts/integration.sh --use-token |
| 39 | + env: |
| 40 | + GIT_TOKEN: ${{ github.token }} |
| 41 | + |
| 42 | + release: |
| 43 | + name: Release |
| 44 | + runs-on: ubuntu-latest |
| 45 | + needs: integration |
| 46 | + steps: |
| 47 | + - name: Setup Go |
| 48 | + uses: actions/setup-go@v1 |
| 49 | + with: |
| 50 | + go-version: 1.16 |
| 51 | + - name: Checkout |
| 52 | + uses: actions/checkout@v2 |
| 53 | + - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true |
| 54 | + - name: Reset Draft Release |
| 55 | + id: reset |
| 56 | + uses: paketo-buildpacks/github-config/actions/release/reset-draft@main |
| 57 | + with: |
| 58 | + repo: ${{ github.repository }} |
| 59 | + token: ${{ github.token }} |
| 60 | + - name: Tag |
| 61 | + id: tag |
| 62 | + uses: paketo-buildpacks/github-config/actions/tag@main |
| 63 | + with: |
| 64 | + current_version: ${{ steps.reset.outputs.current_version }} |
| 65 | + - name: Package |
| 66 | + run: ./scripts/package.sh --version "${{ steps.tag.outputs.tag }}" |
| 67 | + - name: Create Release Notes |
| 68 | + id: create-release-notes |
| 69 | + uses: paketo-buildpacks/github-config/actions/release/notes@main |
| 70 | + - name: Create Release |
| 71 | + uses: paketo-buildpacks/github-config/actions/release/create@main |
| 72 | + with: |
| 73 | + repo: ${{ github.repository }} |
| 74 | + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} |
| 75 | + tag_name: v${{ steps.tag.outputs.tag }} |
| 76 | + target_commitish: ${{ github.sha }} |
| 77 | + name: v${{ steps.tag.outputs.tag }} |
| 78 | + body: ${{ steps.create-release-notes.outputs.release_body }} |
| 79 | + draft: true |
| 80 | + assets: | |
| 81 | + [ |
| 82 | + { |
| 83 | + "path": "build/buildpack.tgz", |
| 84 | + "name": "${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.tgz", |
| 85 | + "content_type": "application/gzip" |
| 86 | + }, |
| 87 | + { |
| 88 | + "path": "build/buildpackage.cnb", |
| 89 | + "name": "${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.cnb", |
| 90 | + "content_type": "application/gzip" |
| 91 | + } |
| 92 | + ] |
0 commit comments