From 204c53dcb2bd5e34a9a2f6eb5fd24293fa936ed4 Mon Sep 17 00:00:00 2001 From: "R.I.Pienaar" Date: Tue, 14 Mar 2023 18:09:56 +0100 Subject: [PATCH] adds a nightly build action and build nightly rc from main Signed-off-by: R.I.Pienaar --- .github/actions/nightly-release/action.yaml | 56 +++++++++++++++++++++ .github/workflows/rc_nightly.yaml | 17 +++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/actions/nightly-release/action.yaml create mode 100644 .github/workflows/rc_nightly.yaml diff --git a/.github/actions/nightly-release/action.yaml b/.github/actions/nightly-release/action.yaml new file mode 100644 index 00000000..3de9349e --- /dev/null +++ b/.github/actions/nightly-release/action.yaml @@ -0,0 +1,56 @@ +name: Nightly Docker Releaser +description: Builds nightly docker images + +inputs: + go: + description: The version of go to build with + required: true + + branch: + description: The branch to build + required: true + + label: + description: The label to use for built images + required: true + +runs: + using: composite + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + path: src/github.com/nats-io/nats-server + ref: ${{ inputs.branch }} + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: "${{ inputs.go }}" + + - name: goreleaser + uses: goreleaser/goreleaser-action@v3 + env: + LABEL: + with: + version: latest + args: release --snapshot --config .goreleaser-nightly.yml + + - name: images + shell: bash + run: | + docker images + + - name: docker_login + run: | + docker login -u "${{ secrets.DOCKER_USERNAME }}" -p "${{ secrets.DOCKER_PASSWORD }}" + + - name: docker_push + run: | + NDATE=$(date +%Y%m%d) + + docker tag synadia/nats-server:nightly-${NDATE} synadia/nats-server:${{ inputs.label }}-${NDATE} + docker tag synadia/nats-server:nightly-${NDATE} synadia/nats-server:${{ inputs.label }} + + docker push synadia/nats-server:${{ inputs.label }}-${NDATE} + docker push synadia/nats-server:${{ inputs.label }} diff --git a/.github/workflows/rc_nightly.yaml b/.github/workflows/rc_nightly.yaml new file mode 100644 index 00000000..5f1676e8 --- /dev/null +++ b/.github/workflows/rc_nightly.yaml @@ -0,0 +1,17 @@ +name: NATS Server Nightly RC +on: + workflow_dispatch: {} + + schedule: + - cron: "40 4 * * *" + + +jobs: + rc_release: + runs-on: ubuntu-latest + steps: + - uses: ./.github/actions/nightly-release + with: + go: "1.19" + branch: main + label: nightly-main