|
| 1 | +name: Release workflow |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: write |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + tags: "*" |
| 9 | + |
| 10 | +jobs: |
| 11 | + prepare: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Create Release |
| 15 | + uses: softprops/action-gh-release@v2 |
| 16 | + id: create_release |
| 17 | + env: |
| 18 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 19 | + build: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + needs: prepare |
| 22 | + strategy: |
| 23 | + max-parallel: 1 |
| 24 | + matrix: |
| 25 | + arch: |
| 26 | + - amd64 |
| 27 | + - arm64 |
| 28 | + php_version: |
| 29 | + - "7.2" |
| 30 | + - "7.3" |
| 31 | + - "7.4" |
| 32 | + - "8.0" |
| 33 | + - "8.1" |
| 34 | + - "8.2" |
| 35 | + - "8.3" |
| 36 | + steps: |
| 37 | + - name: Checkout |
| 38 | + uses: actions/checkout@v4 |
| 39 | + - name: Set up QEMU |
| 40 | + uses: docker/setup-qemu-action@v1 |
| 41 | + with: |
| 42 | + platforms: linux/${{ matrix.arch }} |
| 43 | + - name: Build nop_${{ matrix.arch }}_${{ matrix.php_version }}.so.out |
| 44 | + run: | |
| 45 | + docker run \ |
| 46 | + --rm \ |
| 47 | + -v ${{ github.workspace }}:/workspace \ |
| 48 | + -w /workspace \ |
| 49 | + --platform linux/${{ matrix.arch }} \ |
| 50 | + php:${{ matrix.php_version }}-cli \ |
| 51 | + ./scripts/build-extension |
| 52 | + - name: Generate nfpm.${{ matrix.arch }}.${{ matrix.php_version }}.yaml |
| 53 | + run: ./scripts/nfpm-template |
| 54 | + env: |
| 55 | + VERSION: ${{ github.ref_name }} |
| 56 | + ARCH: ${{ matrix.arch }} |
| 57 | + PHP_VERSION: ${{ matrix.php_version }} |
| 58 | + - name: Package php${{ matrix.php_version }}-nop_${{ matrix.arch }}_${{ github.ref_name }}.deb |
| 59 | + run: | |
| 60 | + docker run \ |
| 61 | + --rm \ |
| 62 | + -v ${{ github.workspace }}:/workspace \ |
| 63 | + -w /workspace \ |
| 64 | + --platform linux/${{ matrix.arch }} \ |
| 65 | + goreleaser/nfpm:v2.41.0 \ |
| 66 | + pkg \ |
| 67 | + --packager deb \ |
| 68 | + --config nfpm.${{ matrix.arch }}.${{ matrix.php_version }}.yaml \ |
| 69 | + --target ./private/php${{ matrix.php_version }}-nop_${{ matrix.arch }}_${{ github.ref_name }}.deb |
| 70 | + - name: Upload php${{ matrix.php_version }}-nop_${{ matrix.arch }}_${{ github.ref_name }}.deb |
| 71 | + id: upload-release-asset |
| 72 | + uses: softprops/action-gh-release@v2 |
| 73 | + env: |
| 74 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 75 | + with: |
| 76 | + files: ./private/php${{ matrix.php_version }}-nop_${{ matrix.arch }}_${{ github.ref_name }}.deb |
0 commit comments