mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
23ce6710eb
Bumps the gha-dependencies group with 5 updates: | Package | From | To | | --- | --- | --- | | [github/codeql-action](https://github.com/github/codeql-action) | `3.28.10` | `3.28.13` | | [8398a7/action-slack](https://github.com/8398a7/action-slack) | `3.16.2` | `3.18.0` | | [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) | `0.29.0` | `0.30.0` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.6.1` | `4.6.2` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `4.1.9` | `4.2.1` | Updates `github/codeql-action` from 3.28.10 to 3.28.13 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d...1b549b9259bda1cb5ddde3b41741a82a2d15a841) Updates `8398a7/action-slack` from 3.16.2 to 3.18.0 - [Release notes](https://github.com/8398a7/action-slack/releases) - [Commits](https://github.com/8398a7/action-slack/compare/28ba43ae48961b90635b50953d216767a6bea486...1750b5085f3ec60384090fb7c52965ef822e869e) Updates `aquasecurity/trivy-action` from 0.29.0 to 0.30.0 - [Release notes](https://github.com/aquasecurity/trivy-action/releases) - [Commits](https://github.com/aquasecurity/trivy-action/compare/18f2510ee396bbf400402947b394f2dd8c87dbb0...6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5) Updates `actions/upload-artifact` from 4.6.1 to 4.6.2 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1...ea165f8d65b6e75b540449e92b4886f43607fa02) Updates `actions/download-artifact` from 4.1.9 to 4.2.1 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/cc203385981b70ca67e1cc392babf9cc229d5806...95815c38cf2ff2164869cbab79da8d1f422bc89e) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 3.28.13 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gha-dependencies - dependency-name: 8398a7/action-slack dependency-version: 3.18.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: gha-dependencies - dependency-name: aquasecurity/trivy-action dependency-version: 0.30.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: gha-dependencies - dependency-name: actions/upload-artifact dependency-version: 4.6.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: gha-dependencies - dependency-name: actions/download-artifact dependency-version: 4.2.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: gha-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
208 lines
6.3 KiB
YAML
208 lines
6.3 KiB
YAML
name: Post Merge
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
generate:
|
|
permissions:
|
|
contents: write # for Git to git push
|
|
name: Sync Generated Code and Docs
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
token: ${{ secrets.GH_PUSH_TOKEN }} # required to push to protected branch below
|
|
|
|
- name: Generate
|
|
run: make clean generate docs-generate-cli-docs
|
|
|
|
- name: Commit & Push
|
|
shell: bash
|
|
run: |
|
|
# Commit any changes and push as needed.
|
|
|
|
# See https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
|
|
AUTHOR=wasm-updater
|
|
git config user.name ${AUTHOR}
|
|
git config user.email ${AUTHOR}@github.com
|
|
|
|
# Prevent looping if the build was non-deterministic..
|
|
CAN_PUSH=1
|
|
if [[ "$(git log -1 --pretty=format:'%an')" == "${AUTHOR}" ]]; then
|
|
CAN_PUSH=0
|
|
fi
|
|
|
|
if ./build/commit-wasm-bins.sh; then
|
|
if [[ "${CAN_PUSH}" == "1" ]]; then
|
|
git push
|
|
else
|
|
echo "Previous commit was auto-generated -- Aborting!"
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "No generated changes to push!"
|
|
fi
|
|
|
|
AUTHOR=cli-docs-updater
|
|
git config user.name ${AUTHOR}
|
|
git config user.email ${AUTHOR}@github.com
|
|
|
|
# Prevent looping if the build was non-deterministic..
|
|
CAN_PUSH=1
|
|
if [[ "$(git log -1 --pretty=format:'%an')" == "${AUTHOR}" ]]; then
|
|
CAN_PUSH=0
|
|
fi
|
|
|
|
if ./build/commit-cli-docs.sh; then
|
|
if [[ "${CAN_PUSH}" == "1" ]]; then
|
|
git push
|
|
else
|
|
echo "Previous commit was auto-generated -- Aborting!"
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "No generated changes to push!"
|
|
fi
|
|
|
|
code-coverage:
|
|
name: Update Go Test Coverage
|
|
runs-on: ubuntu-24.04
|
|
needs: generate
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
- name: Unit Test Golang
|
|
run: make ci-go-test-coverage
|
|
timeout-minutes: 30
|
|
|
|
release-build:
|
|
name: Release Build (linux, windows)
|
|
runs-on: ubuntu-24.04
|
|
needs: generate
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- name: Git Describe
|
|
run: git describe --tags
|
|
|
|
- name: Build Linux and Windows
|
|
run: make ci-go-ci-build-linux ci-go-ci-build-linux-static ci-go-ci-build-windows
|
|
timeout-minutes: 30
|
|
env:
|
|
TELEMETRY_URL: ${{ secrets.TELEMETRY_URL }}
|
|
|
|
- name: Build Linux arm64
|
|
run: make ci-go-ci-build-linux-static
|
|
timeout-minutes: 30
|
|
env:
|
|
GOARCH: arm64
|
|
TELEMETRY_URL: ${{ secrets.TELEMETRY_URL }}
|
|
|
|
- name: Upload binaries
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
if: always()
|
|
with:
|
|
name: binaries-linux-windows
|
|
path: _release
|
|
|
|
release-build-darwin:
|
|
name: Release Build (darwin)
|
|
runs-on: macos-14
|
|
needs: generate
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- name: Git Describe
|
|
run: git describe --tags
|
|
|
|
- id: go_version
|
|
name: Read go version
|
|
run: echo "go_version=$(cat .go-version)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Install Go (${{ steps.go_version.outputs.go_version }})
|
|
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
|
|
with:
|
|
go-version: ${{ steps.go_version.outputs.go_version }}
|
|
|
|
- name: Build Darwin
|
|
run: |
|
|
make ci-build-darwin GOARCH=amd64
|
|
make ci-build-darwin-arm64-static
|
|
timeout-minutes: 30
|
|
env:
|
|
TELEMETRY_URL: ${{ secrets.TELEMETRY_URL }}
|
|
|
|
- name: Upload binaries (darwin)
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
if: always()
|
|
with:
|
|
name: binaries-darwin
|
|
path: _release
|
|
|
|
deploy-edge:
|
|
name: Push Edge Release
|
|
runs-on: ubuntu-24.04
|
|
needs: [release-build, release-build-darwin]
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
- name: Test
|
|
run: make ci-release-test
|
|
timeout-minutes: 60
|
|
|
|
- name: Download release binaries
|
|
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
|
|
with:
|
|
pattern: binaries-*
|
|
merge-multiple: true
|
|
path: _release
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
|
|
|
|
- name: Deploy OPA Edge
|
|
env:
|
|
DOCKER_USER: ${{ secrets.DOCKER_USER }}
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}
|
|
S3_RELEASE_BUCKET: ${{ secrets.S3_RELEASE_BUCKET }}
|
|
# Only run if required secrets are provided
|
|
if: ${{ env.S3_RELEASE_BUCKET && env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY && env.DOCKER_USER && env.DOCKER_PASSWORD }}
|
|
run: make deploy-ci
|
|
|
|
deploy-wasm-builder:
|
|
name: Deploy WASM Builder
|
|
runs-on: ubuntu-24.04
|
|
needs: generate
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
- name: Build and Push opa-wasm-builder
|
|
env:
|
|
DOCKER_USER: ${{ secrets.DOCKER_USER }}
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
DOCKER_WASM_BUILDER_IMAGE: ${{ secrets.DOCKER_WASM_BUILDER_IMAGE }}
|
|
# Only run if required secrets are provided
|
|
if: ${{ env.DOCKER_USER && env.DOCKER_PASSWORD }}
|
|
run: make push-wasm-builder-image
|