diff options
Diffstat (limited to 'teleirc/matterbridge/.github/workflows')
| -rw-r--r-- | teleirc/matterbridge/.github/workflows/codeql-analysis.yml | 71 | ||||
| -rw-r--r-- | teleirc/matterbridge/.github/workflows/development.yml | 58 | ||||
| -rw-r--r-- | teleirc/matterbridge/.github/workflows/docker.yml | 68 |
3 files changed, 197 insertions, 0 deletions
diff --git a/teleirc/matterbridge/.github/workflows/codeql-analysis.yml b/teleirc/matterbridge/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..8523184 --- /dev/null +++ b/teleirc/matterbridge/.github/workflows/codeql-analysis.yml @@ -0,0 +1,71 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +name: "CodeQL" + +on: + push: + branches: [master] + pull_request: + # The branches below must be a subset of the branches above + branches: [master] + schedule: + - cron: '0 16 * * 1' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['go'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # âšī¸ Command-line programs to run using the OS shell. + # đ https://git.io/JvXDl + + # âī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/teleirc/matterbridge/.github/workflows/development.yml b/teleirc/matterbridge/.github/workflows/development.yml new file mode 100644 index 0000000..4d00e0e --- /dev/null +++ b/teleirc/matterbridge/.github/workflows/development.yml @@ -0,0 +1,58 @@ +name: Development +on: [push, pull_request] +jobs: + lint: + name: golangci-lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 20 + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: latest + args: "-v --new-from-rev HEAD~5" + test-build-upload: + strategy: + matrix: + go-version: [1.18.x] + platform: [ubuntu-latest] + runs-on: ${{ matrix.platform }} + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + stable: false + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Test + run: go test ./... -mod=vendor + - name: Build + run: | + mkdir -p output/{win,lin,arm,mac} + VERSION=$(git describe --tags) + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -X github.com/42wim/matterbridge/version.GitHash=$(git log --pretty=format:'%h' -n 1)" -o output/lin/matterbridge-$VERSION-linux-amd64 + CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -X github.com/42wim/matterbridge/version.GitHash=$(git log --pretty=format:'%h' -n 1)" -o output/win/matterbridge-$VERSION-windows-amd64.exe + CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -X github.com/42wim/matterbridge/version.GitHash=$(git log --pretty=format:'%h' -n 1)" -o output/mac/matterbridge-$VERSION-darwin-amd64 + - name: Upload linux 64-bit + if: startsWith(matrix.go-version,'1.18') + uses: actions/upload-artifact@v2 + with: + name: matterbridge-linux-64bit + path: output/lin + - name: Upload windows 64-bit + if: startsWith(matrix.go-version,'1.18') + uses: actions/upload-artifact@v2 + with: + name: matterbridge-windows-64bit + path: output/win + - name: Upload darwin 64-bit + if: startsWith(matrix.go-version,'1.18') + uses: actions/upload-artifact@v2 + with: + name: matterbridge-darwin-64bit + path: output/mac diff --git a/teleirc/matterbridge/.github/workflows/docker.yml b/teleirc/matterbridge/.github/workflows/docker.yml new file mode 100644 index 0000000..c1caf27 --- /dev/null +++ b/teleirc/matterbridge/.github/workflows/docker.yml @@ -0,0 +1,68 @@ +name: docker + +on: + push: + branches: + - 'master' + tags: + - 'v*' + pull_request: + branches: + - 'master' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: amd64,arm64 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: 42wim/matterbridge,ghcr.io/42wim/matterbridge + flavor: | + latest=true + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern=stable + type=semver,pattern={{major}} + type=semver,pattern={{major}}.{{minor}} + - + name: Login to DockerHub + uses: docker/login-action@v1 + if: github.event_name != 'pull_request' + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Log into registry ghcr.io + uses: docker/login-action@v1 + if: github.event_name != 'pull_request' + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + |
