apply prettier to the entire repository (#5799)
This commit is contained in:
+47
-47
@@ -2,101 +2,101 @@ name: lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
go:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
|
||||
- run: go generate ./...
|
||||
- run: go generate ./...
|
||||
|
||||
- uses: golangci/golangci-lint-action@v9
|
||||
with:
|
||||
version: v2.12.2
|
||||
- uses: golangci/golangci-lint-action@v9
|
||||
with:
|
||||
version: v2.12.2
|
||||
|
||||
go_mod:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
|
||||
- run: make lint-go-mod
|
||||
- run: make lint-go-mod
|
||||
|
||||
conf:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
|
||||
- run: make lint-conf
|
||||
- run: make lint-conf
|
||||
|
||||
go2api:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
|
||||
- run: make lint-go2api
|
||||
- run: make lint-go2api
|
||||
|
||||
docslinks:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
|
||||
- run: make lint-docslinks
|
||||
- run: make lint-docslinks
|
||||
|
||||
docsorder:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
|
||||
- run: make lint-docsorder
|
||||
|
||||
docs:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- run: make lint-docs
|
||||
- run: make lint-docsorder
|
||||
|
||||
api_docs:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- run: make lint-api-docs
|
||||
- run: make lint-api-docs
|
||||
|
||||
other:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- run: make lint-other
|
||||
|
||||
@@ -8,13 +8,13 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- run: make binaries
|
||||
- run: make binaries
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: binaries
|
||||
path: binaries
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: binaries
|
||||
path: binaries
|
||||
|
||||
+103
-103
@@ -3,7 +3,7 @@ name: release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
@@ -18,144 +18,144 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- run: make binaries
|
||||
- run: make binaries
|
||||
|
||||
- run: cd binaries && sha256sum -b * > checksums.sha256
|
||||
- run: cd binaries && sha256sum -b * > checksums.sha256
|
||||
|
||||
- uses: actions/attest@v4
|
||||
with:
|
||||
subject-path: '${{ github.workspace }}/binaries/*'
|
||||
- uses: actions/attest@v4
|
||||
with:
|
||||
subject-path: "${{ github.workspace }}/binaries/*"
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: binaries
|
||||
path: binaries
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: binaries
|
||||
path: binaries
|
||||
|
||||
github_release:
|
||||
needs: binaries
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: binaries
|
||||
path: binaries
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: binaries
|
||||
path: binaries
|
||||
|
||||
- uses: actions/github-script@v9
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const fs = require('fs').promises;
|
||||
const { repo: { owner, repo } } = context;
|
||||
- uses: actions/github-script@v9
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const fs = require('fs').promises;
|
||||
const { repo: { owner, repo } } = context;
|
||||
|
||||
const currentRelease = context.ref.split('/')[2];
|
||||
const currentRelease = context.ref.split('/')[2];
|
||||
|
||||
let body = `## New major features\n`
|
||||
+ `\n`
|
||||
+ `TODO\n`
|
||||
+ `\n`
|
||||
+ `## Fixes and improvements\n`
|
||||
+ `\n`
|
||||
+ `TODO\n`
|
||||
+ `\n`
|
||||
+ `## Security\n`
|
||||
+ `\n`
|
||||
+ `Binaries are compiled from source code by the [Release workflow](https://github.com/${owner}/${repo}/actions/workflows/release.yml), which is a fully-visible process that prevents any change or external interference in produced artifacts.\n`
|
||||
+ `\n`
|
||||
+ 'Checksums of binaries are also published in a public blockchain by using [GitHub Attestations](https://docs.github.com/en/actions/concepts/security/artifact-attestations), and they can be verified by running:\n'
|
||||
+ `\n`
|
||||
+ '```\n'
|
||||
+ `ls mediamtx_* | xargs -L1 gh attestation verify --repo bluenviron/mediamtx\n`
|
||||
+ '```\n'
|
||||
+ `\n`
|
||||
+ 'You can verify checksums of binaries by downloading `checksums.sha256` and running:\n'
|
||||
+ `\n`
|
||||
+ '```\n'
|
||||
+ `cat checksums.sha256 | grep "$(ls mediamtx_*)" | sha256sum --check\n`
|
||||
+ '```\n'
|
||||
+ `\n`;
|
||||
let body = `## New major features\n`
|
||||
+ `\n`
|
||||
+ `TODO\n`
|
||||
+ `\n`
|
||||
+ `## Fixes and improvements\n`
|
||||
+ `\n`
|
||||
+ `TODO\n`
|
||||
+ `\n`
|
||||
+ `## Security\n`
|
||||
+ `\n`
|
||||
+ `Binaries are compiled from source code by the [Release workflow](https://github.com/${owner}/${repo}/actions/workflows/release.yml), which is a fully-visible process that prevents any change or external interference in produced artifacts.\n`
|
||||
+ `\n`
|
||||
+ 'Checksums of binaries are also published in a public blockchain by using [GitHub Attestations](https://docs.github.com/en/actions/concepts/security/artifact-attestations), and they can be verified by running:\n'
|
||||
+ `\n`
|
||||
+ '```\n'
|
||||
+ `ls mediamtx_* | xargs -L1 gh attestation verify --repo bluenviron/mediamtx\n`
|
||||
+ '```\n'
|
||||
+ `\n`
|
||||
+ 'You can verify checksums of binaries by downloading `checksums.sha256` and running:\n'
|
||||
+ `\n`
|
||||
+ '```\n'
|
||||
+ `cat checksums.sha256 | grep "$(ls mediamtx_*)" | sha256sum --check\n`
|
||||
+ '```\n'
|
||||
+ `\n`;
|
||||
|
||||
const res = await github.rest.repos.createRelease({
|
||||
owner,
|
||||
repo,
|
||||
tag_name: currentRelease,
|
||||
name: currentRelease,
|
||||
body,
|
||||
});
|
||||
const release_id = res.data.id;
|
||||
|
||||
for (const name of await fs.readdir('./binaries/')) {
|
||||
await github.rest.repos.uploadReleaseAsset({
|
||||
const res = await github.rest.repos.createRelease({
|
||||
owner,
|
||||
repo,
|
||||
release_id,
|
||||
name,
|
||||
data: await fs.readFile(`./binaries/${name}`),
|
||||
tag_name: currentRelease,
|
||||
name: currentRelease,
|
||||
body,
|
||||
});
|
||||
}
|
||||
const release_id = res.data.id;
|
||||
|
||||
for (const name of await fs.readdir('./binaries/')) {
|
||||
await github.rest.repos.uploadReleaseAsset({
|
||||
owner,
|
||||
repo,
|
||||
release_id,
|
||||
name,
|
||||
data: await fs.readFile(`./binaries/${name}`),
|
||||
});
|
||||
}
|
||||
|
||||
github_notify_issues:
|
||||
needs: github_release
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/github-script@v9
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const { repo: { owner, repo } } = context;
|
||||
- uses: actions/github-script@v9
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const { repo: { owner, repo } } = context;
|
||||
|
||||
const tags = await github.rest.repos.listTags({
|
||||
owner,
|
||||
repo,
|
||||
});
|
||||
const tags = await github.rest.repos.listTags({
|
||||
owner,
|
||||
repo,
|
||||
});
|
||||
|
||||
const curTag = tags.data[0];
|
||||
const prevTag = tags.data[1];
|
||||
const curTag = tags.data[0];
|
||||
const prevTag = tags.data[1];
|
||||
|
||||
const diff = await github.rest.repos.compareCommitsWithBasehead({
|
||||
owner,
|
||||
repo,
|
||||
basehead: `${prevTag.commit.sha}...${curTag.commit.sha}`,
|
||||
});
|
||||
const diff = await github.rest.repos.compareCommitsWithBasehead({
|
||||
owner,
|
||||
repo,
|
||||
basehead: `${prevTag.commit.sha}...${curTag.commit.sha}`,
|
||||
});
|
||||
|
||||
const issues = {};
|
||||
const issues = {};
|
||||
|
||||
for (const commit of diff.data.commits) {
|
||||
for (const match of commit.commit.message.matchAll(/(^| |\()#([0-9]+)( |\)|$)/g)) {
|
||||
issues[match[2]] = 1;
|
||||
for (const commit of diff.data.commits) {
|
||||
for (const match of commit.commit.message.matchAll(/(^| |\()#([0-9]+)( |\)|$)/g)) {
|
||||
issues[match[2]] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const issue in issues) {
|
||||
try {
|
||||
await github.rest.issues.createComment({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: parseInt(issue),
|
||||
body: `This issue is mentioned in release ${curTag.name} 🚀\n`
|
||||
+ `Check out the entire changelog by [clicking here](https://github.com/${owner}/${repo}/releases/tag/${curTag.name})`,
|
||||
});
|
||||
} catch (exc) {
|
||||
console.error(exc.toString());
|
||||
for (const issue in issues) {
|
||||
try {
|
||||
await github.rest.issues.createComment({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: parseInt(issue),
|
||||
body: `This issue is mentioned in release ${curTag.name} 🚀\n`
|
||||
+ `Check out the entire changelog by [clicking here](https://github.com/${owner}/${repo}/releases/tag/${curTag.name})`,
|
||||
});
|
||||
} catch (exc) {
|
||||
console.error(exc.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dockerhub:
|
||||
needs: binaries
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: binaries
|
||||
path: binaries
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: binaries
|
||||
path: binaries
|
||||
|
||||
- run: make dockerhub
|
||||
env:
|
||||
DOCKER_USER: ${{ secrets.DOCKER_USER }}
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- run: make dockerhub
|
||||
env:
|
||||
DOCKER_USER: ${{ secrets.DOCKER_USER }}
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
+20
-20
@@ -2,45 +2,45 @@ name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test_64:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- run: make test
|
||||
- run: make test
|
||||
|
||||
- uses: codecov/codecov-action@v6
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
- uses: codecov/codecov-action@v6
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
test_32:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- run: make test-32
|
||||
- run: make test-32
|
||||
|
||||
test_e2e:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26"
|
||||
|
||||
- run: make test-e2e-nodocker
|
||||
- run: make test-e2e-nodocker
|
||||
|
||||
Reference in New Issue
Block a user