|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + name: Build and release |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout code |
| 14 | + uses: actions/checkout@v2 |
| 15 | + - name: Get the version |
| 16 | + id: get_version |
| 17 | + run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} |
| 18 | + - name: Test on PG11 |
| 19 | + run: env USE_DOCKER=1 POSTGRES_VERSION=11 ./build-and-test.sh |
| 20 | + - name: Test on PG12 |
| 21 | + run: env USE_DOCKER=1 POSTGRES_VERSION=12 ./build-and-test.sh |
| 22 | + - name: Build for PG11 |
| 23 | + run: env POSTGRES_VERSION=11 ./docker-build-dist.sh |
| 24 | + - name: Build for PG12 |
| 25 | + run: env POSTGRES_VERSION=12 ./docker-build-dist.sh |
| 26 | + - name: Create Release |
| 27 | + id: create_release |
| 28 | + uses: actions/create-release@v1 |
| 29 | + env: |
| 30 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 31 | + with: |
| 32 | + tag_name: ${{ github.ref }} |
| 33 | + release_name: ${{ steps.get_version.outputs.VERSION }} |
| 34 | + draft: false |
| 35 | + prerelease: false |
| 36 | + - name: Upload PG11 tarball |
| 37 | + uses: actions/upload-release-asset@v1 |
| 38 | + env: |
| 39 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + with: |
| 41 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 42 | + asset_path: ./dist/postgres-protobuf-${{ steps.get_version.outputs.VERSION }}-linux-x86_64-for-pg11.tar.gz |
| 43 | + asset_name: postgres-protobuf-${{ steps.get_version.outputs.VERSION }}-linux-x86_64-for-pg11.tar.gz |
| 44 | + asset_content_type: application/gzip |
| 45 | + - name: Upload PG12 tarball |
| 46 | + uses: actions/upload-release-asset@v1 |
| 47 | + env: |
| 48 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + with: |
| 50 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 51 | + asset_path: ./dist/postgres-protobuf-${{ steps.get_version.outputs.VERSION }}-linux-x86_64-for-pg12.tar.gz |
| 52 | + asset_name: postgres-protobuf-${{ steps.get_version.outputs.VERSION }}-linux-x86_64-for-pg12.tar.gz |
| 53 | + asset_content_type: application/gzip |
0 commit comments