diff --git a/.github/actions/version/action.yml b/.github/actions/version/action.yml index 8262bbb..2e865f9 100644 --- a/.github/actions/version/action.yml +++ b/.github/actions/version/action.yml @@ -44,8 +44,8 @@ runs: fi env: MODE: ${{ inputs.mode }} - - uses: actions/download-artifact@v4 - if: ${{ inputs.download_dist == 'true' }} + - if: ${{ inputs.download_dist == 'true' }} + uses: actions/download-artifact@v4 with: name: build path: dist diff --git a/.github/labeler.yml b/.github/labeler.yml index 0f1870b..80a075d 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -64,6 +64,7 @@ autolabeler: - label: javascript files: - "**/*.js" + - "**/*.ts" - label: python files: @@ -79,10 +80,6 @@ autolabeler: - "**/*.zsh" - "**/*.bash" - - label: typescript - files: - - "**/*.ts" - - label: dependencies title: - /.*\(deps\).*/ diff --git a/.github/workflows/integration.yml b/.github/workflows/golang.yml similarity index 67% rename from .github/workflows/integration.yml rename to .github/workflows/golang.yml index 3d8b930..a2d9b61 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/golang.yml @@ -1,7 +1,7 @@ # Code generated by craft; DO NOT EDIT. -name: Integration -run-name: Integration +name: Golang +run-name: Golang on: pull_request: @@ -17,12 +17,18 @@ on: - dev - develop - development - - main - - master - next - staging - - v[0-9]+.[0-9]+.x - - v[0-9]+.x + workflow_call: + inputs: + build: + description: Whether to run build job or not + required: false + type: boolean + version: + description: Build version to use in build metadata + required: true + type: string workflow_dispatch: jobs: @@ -89,8 +95,8 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - run: mkdir -p reports/ - run: go test ./... -coverpkg="./..." -covermode="count" -coverprofile="reports/go-coverage.native.out" -timeout=15s - - uses: codecov/codecov-action@v4 - if: ${{ ! startsWith(github.head_ref, 'dependabot') }} # ignore codecov on dependabot branches + - if: ${{ ! startsWith(github.head_ref, 'dependabot') }} # ignore codecov on dependabot branches + uses: codecov/codecov-action@v4 with: codecov_yml_path: .codecov.yml disable_search: true @@ -101,15 +107,33 @@ jobs: slug: ${{ github.repository }} token: ${{ secrets.CODECOV_TOKEN }} - workflow-result: - name: Workflow Result + go-build: + name: Go Build runs-on: ubuntu-latest - if: ${{ needs.run-workflow.outputs.skip == 'false' && ! cancelled() }} + if: ${{ inputs.build }} needs: - run-workflow - - go-vulncheck - - go-lint - go-test steps: - - run: exit 1 - if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} \ No newline at end of file + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + check-latest: true + go-version-file: go.mod + token: ${{ secrets.GITHUB_TOKEN }} + # https://github.com/marketplace/actions/goreleaser-action + - uses: goreleaser/goreleaser-action@v6 + with: + args: release --clean --config .goreleaser.yml --skip=validate --skip=announce --skip=publish --snapshot + env: + VERSION: ${{ inputs.version }} + - uses: actions/upload-artifact@v4 + with: + name: build + # order is important to filter unwanted globs after the filter or desired globs + path: | + dist/* + !dist/*.json + !dist/*.yaml + !dist/*/ + retention-days: 1 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bcf571b..d79c06e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: version: name: Version runs-on: ubuntu-latest - if: ${{ github.ref_protected }} # skip all jobs since they depend on version job + if: ${{ github.ref_protected }} environment: release permissions: contents: write @@ -52,12 +52,16 @@ jobs: env: INPUT_MODE: ${{ inputs.mode }} - build: - name: Build + golang: + name: Golang needs: version - uses: ./.github/workflows/build.yml + uses: ./.github/workflows/golang.yml + permissions: + checks: write with: + build: true version: ${{ needs.version.outputs.version }} + secrets: inherit release: name: Release @@ -69,7 +73,7 @@ jobs: pull-requests: write needs: - version - - build + - golang steps: - uses: actions/checkout@v4 - uses: ./.github/actions/version