docs: add section to README about OASF record generation #748
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright AGNTCY Contributors (https://github.com/agntcy) | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: CI Pipeline | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*.*.*' | |
| - 'helm/v*.*.*' | |
| pull_request: | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| verify: | |
| name: Verify | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Taskfile | |
| shell: bash | |
| run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: '1.16' | |
| otp-version: '26' | |
| - name: Fetch Elixir deps | |
| run: mix deps.get | |
| working-directory: server | |
| - name: Build code | |
| run: | | |
| # NOTE: We are only interested in codebase, don't build images here | |
| task build:charts | |
| - name: Check code changes | |
| run: | | |
| if [[ -n "$(git status --porcelain)" ]]; then | |
| echo "There are uncommitted changes after running 'task build'. Please commit these changes." | |
| exit 1 | |
| fi | |
| - name: Formatting | |
| run: | | |
| task fmt | |
| - name: Check code changes | |
| run: | | |
| if [[ -n "$(git status --porcelain)" ]]; then | |
| git diff | |
| echo "There are uncommitted changes after running 'task fmt'. Please commit these changes." | |
| exit 1 | |
| fi | |
| - name: Linting | |
| run: task lint | |
| - name: OASF schema validation | |
| run: task test:schema | |
| - name: Checking consistency between json and proto files | |
| run: task test:proto | |
| - name: OASF Server Validation | |
| run: task test:server | |
| prepare: | |
| name: Prepare | |
| needs: | |
| - verify | |
| outputs: | |
| targets: ${{ steps.targets.outputs.targets }} | |
| image_tag: ${{ steps.resolve.outputs.image_tag }} | |
| release_tag: ${{ steps.resolve.outputs.release_tag }} | |
| helm_release_tag: ${{ steps.resolve.outputs.helm_release_tag }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Resolve build details | |
| id: resolve | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| # For push from PR, resolve to <PR number>-<commit sha> | |
| image_tag="${{ format('pr{0}-{1}', github.event.pull_request.number, github.sha) }}" | |
| else | |
| # For push, resolve to <commit sha> | |
| image_tag="${{ format('{0}', github.sha) }}" | |
| fi | |
| # Original release_tag | |
| RAW_RELEASE_TAG="${GITHUB_REF#refs/tags/}" | |
| # Calculate helm_release_tag using bash parameter expansion | |
| # This removes the "helm/" prefix if it exists | |
| HELM_RELEASE_TAG="${RAW_RELEASE_TAG#helm/}" | |
| # Export vars | |
| echo "image_tag=$image_tag" >> "$GITHUB_OUTPUT" | |
| echo "release_tag=$RAW_RELEASE_TAG" >> "$GITHUB_OUTPUT" | |
| echo "helm_release_tag=$HELM_RELEASE_TAG" >> "$GITHUB_OUTPUT" | |
| - name: List targets | |
| id: targets | |
| uses: docker/bake-action/subaction/[email protected] | |
| build: | |
| name: ${{ matrix.targets }} | |
| needs: | |
| - prepare | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| targets: ${{ fromJson(needs.prepare.outputs.targets) }} | |
| uses: ./.github/workflows/reusable-build.yaml | |
| with: | |
| bake_target: ${{ matrix.targets }} | |
| image_repo: ghcr.io/agntcy | |
| image_tag: ${{ needs.prepare.outputs.image_tag }} | |
| artifact_path: artifacts-${{ needs.prepare.outputs.image_tag }} | |
| test: | |
| name: Test | |
| needs: | |
| - prepare | |
| - build | |
| uses: ./.github/workflows/reusable-test.yaml | |
| with: | |
| image_repo: ghcr.io/agntcy | |
| image_tag: ${{ needs.prepare.outputs.image_tag }} | |
| artifact_path: artifacts-${{ needs.prepare.outputs.image_tag }} | |
| release: | |
| name: Server Release | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') && !startsWith(github.ref, 'refs/tags/helm/') }} | |
| needs: | |
| - prepare | |
| - build | |
| - test | |
| uses: ./.github/workflows/reusable-release.yaml | |
| with: | |
| image_repo: ghcr.io/agntcy | |
| image_tag: ${{ needs.prepare.outputs.image_tag }} | |
| release_tag: ${{ needs.prepare.outputs.release_tag }} | |
| artifact_path: artifacts-${{ needs.prepare.outputs.image_tag }} | |
| helm_release: | |
| name: Helm Chart Release | |
| if: ${{ startsWith(github.ref, 'refs/tags/helm/') }} | |
| needs: | |
| - prepare | |
| - verify | |
| uses: ./.github/workflows/reusable-helm-release.yaml | |
| with: | |
| image_repo: ghcr.io/agntcy | |
| release_tag: ${{ needs.prepare.outputs.helm_release_tag }} | |
| success: | |
| name: Success | |
| # https://github.com/actions/runner/issues/2566 | |
| # https://github.com/actions/toolkit/issues/581 | |
| if: ${{ !cancelled() && !contains(needs.*.result, 'cancelled') && !contains(needs.*.result, 'failure') }} | |
| needs: | |
| - prepare | |
| - build | |
| - test | |
| - release | |
| - helm_release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Echo Success | |
| run: echo "::notice Success!" |