Skip to content

Commit 1591898

Browse files
committed
first commit
0 parents  commit 1591898

35 files changed

+5693
-0
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{
6+
"repo": "goplugin/plugin-feeds"
7+
}
8+
],
9+
"privatePackages": {
10+
"version": true,
11+
"tag": true
12+
},
13+
"commit": false,
14+
"fixed": [],
15+
"linked": [],
16+
"access": "restricted",
17+
"baseBranch": "master",
18+
"updateInternalDependencies": "patch",
19+
"ignore": []
20+
}

.github/actionlint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
self-hosted-runner:
2+
- ubuntu20.04-4cores-16GB
3+
- ubuntu20.04-8cores-32GB
4+
- ubuntu20.04-16cores-64GB
5+
- ubuntu20.04-32cores-128GB
6+
- ubuntu20.04-64cores-256GB

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: '/'
5+
schedule:
6+
interval: daily
7+
- package-ecosystem: gomod
8+
directory: '/'
9+
schedule:
10+
interval: daily
11+
- package-ecosystem: docker
12+
directory: '/'
13+
schedule:
14+
interval: daily
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: pull-request-master
2+
3+
on:
4+
merge_group:
5+
pull_request:
6+
branches:
7+
- master
8+
# Only run 1 of this workflow at a time per PR
9+
concurrency:
10+
group: plugin-feeds-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
env:
14+
PACKAGES: "./..."
15+
16+
jobs:
17+
init:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
matrix_packages: ${{ steps.set-matrix-packages.outputs.matrix_packages }}
21+
lint_args_packages: ${{ steps.set-matrix-packages.outputs.lint_args_packages }}
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
25+
with:
26+
fetch-depth: 0
27+
- name: Set matrix packages
28+
id: set-matrix-packages
29+
shell: bash
30+
env:
31+
PACKAGES: ${{ env.PACKAGES }}
32+
run: |
33+
matrix_packages=$(echo "${PACKAGES}" | jq -R 'split(",")' | tr -d "\n\t")
34+
echo "matrix_packages=${matrix_packages}" | tee -a "${GITHUB_OUTPUT}"
35+
- name: Set lint args packages
36+
id: set-lint-args-packages
37+
shell: bash
38+
env:
39+
PACKAGES: ${{ env.PACKAGES }}
40+
# Convert "producer,reports_consumer" to "./producer/... ./reports_consumer/..."
41+
run: echo "lint_args_packages=$(echo "./$(echo $PACKAGES | sed 's/,/\/... .\//g;s/$/\/.../')")" | tee -a "${GITHUB_OUTPUT}"
42+
43+
ci-lint:
44+
runs-on: ubuntu-latest
45+
needs: [init]
46+
permissions:
47+
id-token: write
48+
contents: read
49+
actions: read
50+
steps:
51+
- name: ci-lint
52+
uses: goplugin/.github/actions/ci-lint-go@5b1046c28343660ecb84844c6fa95a66d1cdb52e # [email protected]
53+
with:
54+
# grafana inputs
55+
metrics-job-name: ci-lint
56+
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
57+
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
58+
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
59+
# env inputs
60+
use-env-files: "true"
61+
env-files: ./tools/env/ci.env
62+
# go inputs
63+
use-go-cache: true
64+
go-cache-dep-path: "**/go.sum"
65+
go-version-file: go.mod
66+
golangci-lint-version: "v1.55.2"
67+
golangci-lint-args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml
68+
69+
ci-lint-misc:
70+
runs-on: ubuntu-latest
71+
steps:
72+
- name: ci-lint-misc
73+
uses: goplugin/.github/actions/ci-lint-misc@6b08487b176ef7cad086526d0b54ddff6691c044 # [email protected]
74+
with:
75+
# grafana inputs
76+
metrics-job-name: ci-lint-misc
77+
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
78+
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
79+
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
80+
81+
ci-test:
82+
runs-on: ubuntu-latest
83+
permissions:
84+
id-token: write
85+
contents: read
86+
actions: read
87+
steps:
88+
- name: ci-test
89+
uses: goplugin/.github/actions/ci-test-go@a15f84fcc168830a5341c7f08592eed85bb34913 # [email protected]
90+
with:
91+
# grafana inputs
92+
metrics-job-name: ci-test
93+
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
94+
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
95+
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
96+
# docker inputs
97+
use-docker-compose: "true"
98+
docker-compose-workdir: ./tools/docker/setup-postgres
99+
# env inputs
100+
use-env-files: "true"
101+
env-files: ./tools/env/ci.env
102+
# go inputs
103+
use-go-cache: "true"
104+
go-cache-dep-path: "**/go.sum"
105+
go-version-file: go.mod
106+
go-test-cmd: make test-ci
107+
enable-go-test-race: "true"
108+
109+
ci-sonarqube:
110+
needs: [ci-lint, ci-test]
111+
if: ${{ always() }}
112+
runs-on: ubuntu-latest
113+
steps:
114+
- name: ci-sonarqube
115+
uses: goplugin/.github/actions/ci-sonarqube-go@3e11dbc45e4c8b18dd996fb417ccf22056176388 # [email protected]
116+
with:
117+
# grafana inputs
118+
metrics-job-name: ci-sonarqube
119+
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
120+
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
121+
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
122+
# sonarqube inputs
123+
include-lint: "true"
124+
sonar-token: ${{ secrets.SONAR_TOKEN }}
125+
sonar-host-url: ${{ secrets.SONAR_HOST_URL }}

.github/workflows/push-master.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: push-master
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
env:
9+
PACKAGES: "./..."
10+
11+
jobs:
12+
init:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
matrix_packages: ${{ steps.set-matrix-packages.outputs.matrix_packages }}
16+
lint_args_packages: ${{ steps.set-matrix-packages.outputs.lint_args_packages }}
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
20+
- name: Set matrix packages
21+
id: set-matrix-packages
22+
shell: bash
23+
env:
24+
PACKAGES: ${{ env.PACKAGES }}
25+
run: |
26+
matrix_packages=$(echo "${PACKAGES}" | jq -R 'split(",")' | tr -d "\n\t")
27+
echo "matrix_packages=${matrix_packages}" | tee -a "${GITHUB_OUTPUT}"
28+
- name: Set lint args packages
29+
id: set-lint-args-packages
30+
shell: bash
31+
env:
32+
PACKAGES: ${{ env.PACKAGES }}
33+
run: echo "lint_args_packages=$(echo "./$(echo $PACKAGES | sed 's/,/\/... .\//g;s/$/\/.../')")" | tee -a "${GITHUB_OUTPUT}"
34+
35+
ci-lint:
36+
runs-on: ubuntu-latest
37+
permissions:
38+
id-token: write
39+
contents: read
40+
actions: read
41+
steps:
42+
- name: ci-lint
43+
uses: goplugin/.github/actions/ci-lint-go@5b1046c28343660ecb84844c6fa95a66d1cdb52e # [email protected]
44+
with:
45+
# grafana inputs
46+
metrics-job-name: ci-lint
47+
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
48+
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
49+
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
50+
# env inputs
51+
use-env-files: "true"
52+
env-files: ./tools/env/ci.env
53+
# go inputs
54+
use-go-cache: true
55+
go-cache-dep-path: "**/go.sum"
56+
go-version-file: go.mod
57+
golangci-lint-version: "v1.55.2"
58+
golangci-lint-args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml
59+
60+
ci-test:
61+
runs-on: ubuntu-latest
62+
permissions:
63+
id-token: write
64+
contents: read
65+
actions: read
66+
steps:
67+
- name: ci-test
68+
uses: goplugin/.github/actions/ci-test-go@5b1046c28343660ecb84844c6fa95a66d1cdb52e # [email protected]
69+
with:
70+
# grafana inputs
71+
metrics-job-name: ci-test
72+
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
73+
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
74+
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
75+
# docker inputs
76+
use-docker-compose: "true"
77+
docker-compose-workdir: ./tools/docker/setup-postgres
78+
# env inputs
79+
use-env-files: "true"
80+
env-files: ./tools/env/ci.env
81+
# go inputs
82+
use-go-cache: "true"
83+
go-cache-dep-path: "**/go.sum"
84+
go-version-file: go.mod
85+
go-test-cmd: make test-ci
86+
87+
ci-sonarqube:
88+
needs: [ci-lint, ci-test]
89+
if: ${{ always() }}
90+
runs-on: ubuntu-latest
91+
steps:
92+
- name: ci-sonarqube
93+
uses: goplugin/.github/actions/ci-sonarqube-go@3e11dbc45e4c8b18dd996fb417ccf22056176388 # [email protected]
94+
with:
95+
# grafana inputs
96+
metrics-job-name: ci-sonarqube
97+
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
98+
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
99+
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
100+
# sonarqube inputs
101+
sonar-token: ${{ secrets.SONAR_TOKEN }}
102+
sonar-host-url: ${{ secrets.SONAR_HOST_URL }}
103+
104+
cd-release:
105+
runs-on: ubuntu-latest
106+
permissions:
107+
id-token: write
108+
contents: read
109+
outputs:
110+
changesets_published: ${{ steps.cd-release.outputs.published }}
111+
changesets_publishedPackages: ${{ steps.cd-release.outputs.publishedPackages }}
112+
steps:
113+
- name: cd-release
114+
id: cd-release
115+
uses: goplugin/.github/actions/cicd-changesets@5b1046c28343660ecb84844c6fa95a66d1cdb52e # [email protected]
116+
with:
117+
# general inputs
118+
git-user: app-token-issuer-foundations[bot]
119+
git-email: app-token-issuer-foundations[bot]@users.noreply.github.com
120+
pnpm-use-cache: false
121+
# aws inputs
122+
aws-region: ${{ secrets.AWS_REGION }}
123+
aws-role-arn: ${{ secrets.AWS_OIDC_PLUGIN_FEEDS_CI_CHANGESET_TOKEN_ISSUER_ROLE_ARN }}
124+
aws-lambda-url: ${{ secrets.AWS_FOUNDATIONS_GATI_URL }}
125+
# grafana inputs
126+
metrics-job-name: cd-release
127+
gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }}
128+
gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }}
129+
gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }}
130+
131+
cicd-build-publish-artifacts-release:
132+
# Call push-tag-release for [email protected]
133+
name: Call push-tag-release for ${{ matrix.package.name }}@${{ matrix.package.version }}
134+
if: needs.cd-release.outputs.changesets_published == 'true'
135+
strategy:
136+
fail-fast: false
137+
matrix:
138+
package: ${{ fromJson(needs.cd-release.outputs.changesets_publishedPackages) }}
139+
permissions:
140+
id-token: write
141+
contents: write
142+
actions: read
143+
needs: [cd-release]
144+
uses: ./.github/workflows/push-tag-release.yml
145+
secrets: inherit
146+
with:
147+
tag: "${{ matrix.package.name }}@${{ matrix.package.version }}"

0 commit comments

Comments
 (0)