summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2022-04-04 16:01:45 +0200
committerValery Piashchynski <[email protected]>2022-04-04 16:02:04 +0200
commite0eb40fb6469155521f4545aa3a436d4dd16c5c7 (patch)
tree5e3920808618792efb61567c286a4f16b03f34aa /.github
parent348c0688fcb463692fb1a7309295062019795203 (diff)
ci: update CI
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/release.yml3
-rw-r--r--.github/workflows/release_grpc.yml4
-rw-r--r--.github/workflows/release_nightly.yml171
-rw-r--r--.github/workflows/tests.yml2
4 files changed, 177 insertions, 3 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 51d4ad61..16c69942 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -2,7 +2,8 @@ name: release
on:
release: # Docs: <https://help.github.com/en/articles/events-that-trigger-workflows#release-event-release>
- types: [ published ]
+ types:
+ - released
jobs:
build:
diff --git a/.github/workflows/release_grpc.yml b/.github/workflows/release_grpc.yml
index dc8164bb..4601eeec 100644
--- a/.github/workflows/release_grpc.yml
+++ b/.github/workflows/release_grpc.yml
@@ -2,7 +2,9 @@ name: release_grpc
on:
release: # Docs: <https://help.github.com/en/articles/events-that-trigger-workflows#release-event-release>
- types: [ published ]
+ types:
+ - prereleased
+ - released
jobs:
build:
diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml
new file mode 100644
index 00000000..782ecbf9
--- /dev/null
+++ b/.github/workflows/release_nightly.yml
@@ -0,0 +1,171 @@
+name: release_nightly
+
+on:
+ release: # Docs: <https://help.github.com/en/articles/events-that-trigger-workflows#release-event-release>
+ types:
+ - prereleased
+
+jobs:
+ build:
+ name: Build for ${{ matrix.os }} (${{ matrix.arch }}, ${{ matrix.compiler }})
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ windows, darwin ] # linux, darwin, windows
+ compiler: [ gcc ] # gcc, musl-gcc
+ archiver: [ zip ] # tar, zip
+ arch: [ amd64 ] # amd64, 386
+ include:
+ - os: linux
+ compiler: gcc
+ archiver: tar
+ arch: amd64
+ - os: linux
+ compiler: gcc
+ archiver: tar
+ arch: arm64
+ - os: darwin
+ compiler: gcc
+ archiver: tar
+ arch: arm64
+ - os: ''
+ compiler: musl-gcc # more info: <https://musl.libc.org/>
+ archiver: zip
+ arch: amd64
+ steps:
+ - name: Set up Go
+ uses: actions/setup-go@v2
+ with:
+ go-version: 1.18
+
+ - name: Check out code
+ uses: actions/checkout@v3
+
+ - name: Install musl
+ if: matrix.compiler == 'musl-gcc'
+ run: sudo apt-get install -y musl-tools
+
+ - name: Download dependencies
+ run: go mod download # `-x` means "verbose" mode
+
+ - 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`[ ${{ matrix.os }} = 'windows' ] && echo '.exe'`"
+
+ - name: Compile binary file
+ env:
+ GOOS: ${{ matrix.os }}
+ GOARCH: ${{ matrix.arch }}
+ CC: ${{ matrix.compiler }}
+ 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 -tags=nightly -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" ./cmd/rr
+ stat "./${{ steps.values.outputs.binary-name }}"
+
+ - name: Generate distributive directory name
+ id: dist-dir
+ run: >
+ echo "::set-output name=name::roadrunner-${{ steps.values.outputs.version }}-$(
+ [ ${{ matrix.os }} != '' ] && echo '${{ matrix.os }}' || echo 'unknown'
+ )$(
+ [ ${{ matrix.compiler }} = 'musl-gcc' ] && echo '-musl'
+ )-${{ matrix.arch }}"
+
+ - name: Generate distributive archive name
+ id: dist-arch
+ run: >
+ echo "::set-output name=name::${{ steps.dist-dir.outputs.name }}.$(
+ case ${{ matrix.archiver }} in
+ zip) echo 'zip';;
+ tar) echo 'tar.gz';;
+ *) exit 10;
+ esac
+ )"
+
+ - 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 }}/
+
+ - name: Pack distributive using tar
+ if: matrix.archiver == 'tar'
+ run: tar -zcf "${{ steps.dist-arch.outputs.name }}" "${{ steps.dist-dir.outputs.name }}"
+
+ - name: Pack distributive using zip
+ if: matrix.archiver == 'zip'
+ run: zip -r -q "${{ steps.dist-arch.outputs.name }}" "${{ steps.dist-dir.outputs.name }}"
+
+ - name: Upload artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: ${{ steps.dist-dir.outputs.name }}
+ path: ${{ steps.dist-arch.outputs.name }}
+ if-no-files-found: error
+ retention-days: 30
+
+ - name: Upload binaries to release
+ uses: svenstaro/upload-release-action@v2
+ with:
+ repo_token: ${{ secrets.GITHUB_TOKEN }}
+ file: ${{ steps.dist-arch.outputs.name }}
+ asset_name: ${{ steps.dist-arch.outputs.name }}
+ tag: ${{ github.ref }}
+
+ docker:
+ name: Build docker image
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out code
+ uses: actions/checkout@v3
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v1 # Action page: <https://github.com/docker/setup-qemu-action>
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v1 # Action page: <https://github.com/docker/setup-buildx-action>
+
+ - name: Login to Docker Hub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKER_LOGIN }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
+
+ - name: Login to GitHub Container Registry
+ uses: docker/login-action@v1
+ with:
+ registry: ghcr.io
+ username: ${{ secrets.GHCR_LOGIN }}
+ password: ${{ secrets.GHCR_PASSWORD }}
+
+ - 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`"
+
+ - name: Build image
+ uses: docker/build-push-action@v2 # Action page: <https://github.com/docker/build-push-action>
+ with:
+ context: .
+ file: Dockerfile
+ push: true
+ platforms: linux/amd64,linux/arm64
+ build-args: |
+ APP_VERSION=${{ steps.values.outputs.version }}
+ BUILD_TIME=${{ steps.values.outputs.timestamp }}
+ tags: |
+ spiralscout/roadrunner:latest
+ spiralscout/roadrunner:${{ steps.values.outputs.version }}
+ ghcr.io/spiral/roadrunner:latest
+ ghcr.io/spiral/roadrunner:${{ steps.values.outputs.version }}
+ ghcr.io/roadrunner-server/roadrunner:latest
+ ghcr.io/roadrunner-server/roadrunner:${{ steps.values.outputs.version }}
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index cab80fa2..7b0fcebe 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -1,4 +1,4 @@
-name: tests
+name: rr_cli_tests
on:
push: