diff options
author | Valery Piashchynski <[email protected]> | 2022-05-09 16:23:25 +0200 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2022-05-09 16:23:25 +0200 |
commit | d51bdba91768cd5ca63cc166f46910bd3e0d29cd (patch) | |
tree | 6062fc225c3521b84e8409205fac5d9ffb19ce2f /.github | |
parent | 45e4f3480cbdef03981a57116e41b3611ec3da10 (diff) |
add deb and signed releases
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/release.yml | 24 | ||||
-rw-r--r-- | .github/workflows/release_dep.yml | 96 | ||||
-rw-r--r-- | .github/workflows/release_grpc.yml | 24 | ||||
-rw-r--r-- | .github/workflows/release_nightly.yml | 24 |
4 files changed, 163 insertions, 5 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f5d0aa9b..e05aebba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,6 +29,10 @@ jobs: compiler: gcc archiver: tar arch: arm64 + - os: freebsd + compiler: gcc + archiver: tar + arch: amd64 - os: '' compiler: musl-gcc # more info: <https://musl.libc.org/> archiver: zip @@ -55,12 +59,27 @@ jobs: echo "::set-output name=version::`echo ${GITHUB_REF##*/} | sed -e 's/^[vV ]*//'`" echo "::set-output name=timestamp::`date +%FT%T%z`" echo "::set-output name=binary-name::rr`[ ${{ matrix.os }} = 'windows' ] && echo '.exe'`" + if [ ${{ matrix.os }} == "windows" ]; then + echo "::set-output name=sign-cert-name::rr.exe.asc" + else + echo "::set-output name=sign-cert-name::rr.asc" + fi + + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v4 + with: + gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }} + passphrase: ${{ secrets.GPG_PASS }} + git_user_signingkey: true + git_commit_gpgsign: false - name: Compile binary file env: GOOS: ${{ matrix.os }} GOARCH: ${{ matrix.arch }} CC: ${{ matrix.compiler }} + GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} + GPG_PASS: ${{secrets.GPG_PASS}} CGO_ENABLED: 0 LDFLAGS: >- -s @@ -69,6 +88,7 @@ jobs: run: | go build -trimpath -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" ./cmd/rr stat "./${{ steps.values.outputs.binary-name }}" + gpg --detach-sign --armor "./${{ steps.values.outputs.binary-name }}" - name: Generate distributive directory name id: dist-dir @@ -93,8 +113,8 @@ jobs: - name: Create distributive run: | mkdir ${{ steps.dist-dir.outputs.name }} - mv "./${{ steps.values.outputs.binary-name }}" ./${{ steps.dist-dir.outputs.name }}/ - cp ./README.md ./CHANGELOG.md ./LICENSE ./${{ steps.dist-dir.outputs.name }}/ + mv "./${{ steps.values.outputs.binary-name }}" "./${{ steps.values.outputs.sign-cert-name }}" ./${{ steps.dist-dir.outputs.name }}/ + cp ./README.md ./CHANGELOG.md ./LICENSE ./${{ steps.dist-dir.outputs.name }} - name: Pack distributive using tar if: matrix.archiver == 'tar' diff --git a/.github/workflows/release_dep.yml b/.github/workflows/release_dep.yml new file mode 100644 index 00000000..070d528b --- /dev/null +++ b/.github/workflows/release_dep.yml @@ -0,0 +1,96 @@ +name: release_dep + +on: + release: # Docs: <https://help.github.com/en/articles/events-that-trigger-workflows#release-event-release> + types: + - released + - prereleased + +jobs: + build: + name: Build for ${{ matrix.os }} (${{ matrix.arch }}, ${{ matrix.compiler }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ linux ] + compiler: [ gcc ] + archiver: [ zip ] + arch: [ amd64 ] + + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.18 + + - name: Download dependencies + run: go mod download + + - name: Generate builder values + id: values + run: | + echo "::set-output name=version::`echo ${GITHUB_REF##*/} | sed -e 's/^[vV ]*//'`" + echo "::set-output name=timestamp::`date +%FT%T%z`" + echo "::set-output name=binary-name::rr" + echo "::set-output name=sign-cert-name::rr.asc" + + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v4 + with: + gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }} + passphrase: ${{ secrets.GPG_PASS }} + git_user_signingkey: true + git_commit_gpgsign: false + + - name: Compile binary file + env: + GOOS: ${{ matrix.os }} + GOARCH: ${{ matrix.arch }} + CC: ${{ matrix.compiler }} + GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} + GPG_PASS: ${{secrets.GPG_PASS}} + CGO_ENABLED: 0 + LDFLAGS: >- + -s + -X github.com/roadrunner-server/roadrunner/v2/internal/meta.version=${{ steps.values.outputs.version }} + -X github.com/roadrunner-server/roadrunner/v2/internal/meta.buildTime=${{ steps.values.outputs.timestamp }} + run: | + go build -trimpath -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" ./cmd/rr + stat "./${{ steps.values.outputs.binary-name }}" + gpg --detach-sign --armor "./${{ steps.values.outputs.binary-name }}" + + - name: Create DEB dirs + run: | + mkdir -p dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64/DEBIAN + mkdir -p dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64/usr/bin + ls -la dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64 + + - name: Create DEB control file + run: touch dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64/DEBIAN/control + + - name: Build Debian package + run: | + echo "Package: roadrunner-${{ steps.values.outputs.version }}-linux-amd64.deb" >> dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64/DEBIAN/control + echo "Version: ${{ steps.values.outputs.version }}" >> dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64/DEBIAN/control + echo "Section: custom" >> dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64/DEBIAN/control + echo "Priority: optional" >> dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64/DEBIAN/control + echo "Architecture: amd64" >> dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64/DEBIAN/control + echo "Maintainer: roadrunner.dev" >> dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64/DEBIAN/control + echo "Description: High-performance PHP application server, load-balancer, process manager written in Go and powered with plugins." >> dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64/DEBIAN/control + + cat dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64/DEBIAN/control + + cp "./${{ steps.values.outputs.binary-name }}" dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64/usr/bin/ + dpkg --build dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64 + + - name: Upload dep to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: dist/ubuntu/roadrunner-${{ steps.values.outputs.version }}-linux-amd64.deb + asset_name: roadrunner-${{ steps.values.outputs.version }}-linux-amd64.deb + tag: ${{ github.ref }} diff --git a/.github/workflows/release_grpc.yml b/.github/workflows/release_grpc.yml index d6e0bd39..cd043988 100644 --- a/.github/workflows/release_grpc.yml +++ b/.github/workflows/release_grpc.yml @@ -22,14 +22,22 @@ jobs: compiler: gcc archiver: tar arch: amd64 + #---------- - os: linux compiler: gcc archiver: tar arch: arm64 + #---------- + - os: freebsd + compiler: gcc + archiver: tar + arch: amd64 + #---------- - os: darwin compiler: gcc archiver: tar arch: arm64 + #---------- - os: '' compiler: musl-gcc # more info: <https://musl.libc.org/> archiver: zip @@ -58,6 +66,19 @@ jobs: echo "::set-output name=version::`echo ${GITHUB_REF##*/} | sed -e 's/^[vV ]*//'`" echo "::set-output name=timestamp::`date +%FT%T%z`" echo "::set-output name=binary-name::protoc-gen-php-grpc`[ ${{ matrix.os }} = 'windows' ] && echo '.exe'`" + if [ ${{ matrix.os }} == "windows" ]; then + echo "::set-output name=sign-cert-name::protoc-gen-php-grpc.exe.asc" + else + echo "::set-output name=sign-cert-name::protoc-gen-php-grpc.asc" + fi + + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v4 + with: + gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }} + passphrase: ${{ secrets.GPG_PASS }} + git_user_signingkey: true + git_commit_gpgsign: false - name: Compile binary file env: @@ -70,6 +91,7 @@ jobs: run: | go build -trimpath -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" protoc_plugins/protoc-gen-php-grpc/main.go stat "./${{ steps.values.outputs.binary-name }}" + gpg --detach-sign --armor "./${{ steps.values.outputs.binary-name }}" - name: Generate distributive directory name id: dist-dir @@ -94,7 +116,7 @@ jobs: - name: Create distributive run: | mkdir ${{ steps.dist-dir.outputs.name }} - mv "./${{ steps.values.outputs.binary-name }}" ./${{ steps.dist-dir.outputs.name }}/ + mv "./${{ steps.values.outputs.binary-name }}" "./${{ steps.values.outputs.sign-cert-name }}" ./${{ steps.dist-dir.outputs.name }}/ - name: Pack distributive using tar if: matrix.archiver == 'tar' diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml index ca8f2550..eefb146f 100644 --- a/.github/workflows/release_nightly.yml +++ b/.github/workflows/release_nightly.yml @@ -29,6 +29,10 @@ jobs: compiler: gcc archiver: tar arch: arm64 + - os: freebsd + compiler: gcc + archiver: tar + arch: amd64 - os: '' compiler: musl-gcc # more info: <https://musl.libc.org/> archiver: zip @@ -55,12 +59,27 @@ jobs: echo "::set-output name=version::`echo ${GITHUB_REF##*/} | sed -e 's/^[vV ]*//'`" echo "::set-output name=timestamp::`date +%FT%T%z`" echo "::set-output name=binary-name::rr`[ ${{ matrix.os }} = 'windows' ] && echo '.exe'`" + if [ ${{ matrix.os }} == "windows" ]; then + echo "::set-output name=sign-cert-name::rr.exe.asc" + else + echo "::set-output name=sign-cert-name::rr.asc" + fi + + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v4 + with: + gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }} + passphrase: ${{ secrets.GPG_PASS }} + git_user_signingkey: true + git_commit_gpgsign: false - name: Compile binary file env: GOOS: ${{ matrix.os }} GOARCH: ${{ matrix.arch }} CC: ${{ matrix.compiler }} + GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} + GPG_PASS: ${{secrets.GPG_PASS}} CGO_ENABLED: 0 LDFLAGS: >- -s @@ -69,6 +88,7 @@ jobs: run: | go build -trimpath -tags=nightly -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" ./cmd/rr stat "./${{ steps.values.outputs.binary-name }}" + gpg --detach-sign --armor "./${{ steps.values.outputs.binary-name }}" - name: Generate distributive directory name id: dist-dir @@ -93,8 +113,8 @@ jobs: - name: Create distributive run: | mkdir ${{ steps.dist-dir.outputs.name }} - mv "./${{ steps.values.outputs.binary-name }}" ./${{ steps.dist-dir.outputs.name }}/ - cp ./README.md ./CHANGELOG.md ./LICENSE ./${{ steps.dist-dir.outputs.name }}/ + mv "./${{ steps.values.outputs.binary-name }}" "./${{ steps.values.outputs.sign-cert-name }}" ./${{ steps.dist-dir.outputs.name }}/ + cp ./README.md ./CHANGELOG.md ./LICENSE ./${{ steps.dist-dir.outputs.name }} - name: Pack distributive using tar if: matrix.archiver == 'tar' |