Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Aug 2, 2023
1 parent c4cd100 commit 7485c6b
Show file tree
Hide file tree
Showing 14 changed files with 256 additions and 207 deletions.
17 changes: 7 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
reviewers:
- "nginxinc/kic"
- package-ecosystem: "docker"
directory: "/docker"
interval: weekly

- package-ecosystem: docker
directory: /docker
schedule:
interval: daily
reviewers:
- "nginxinc/kic"
interval: weekly
23 changes: 23 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
change:
- head-branch: ['^change/']

enhancement:
- head-branch: ['^feature/', '^feat/', '^enhancement/', '^enh/']

bug:
- head-branch: ['^fix/', '^bug/']

chore:
- head-branch: ['^chore/']

tests:
- head-branch: ['^tests/', '^test/']
- changed-files: 'tests/**/*'

documentation:
- head-branch: ['^docs/', '^doc/']
- changed-files: '**/*.md'

dependencies:
- head-branch: ['^deps/', '^dep/', '^dependabot/']
- changed-files: ['go.mod', 'go.sum']
69 changes: 0 additions & 69 deletions .github/release-drafter.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
changelog:
exclude:
labels:
- skip changelog
categories:
- title: 💣 Breaking Changes
labels:
- change
- title: 🚀 Features
labels:
- enhancement
- title: 🐛 Bug Fixes
labels:
- bug
- title: 🧪 Tests
labels:
- tests
- title: 🔨 Maintenance
labels:
- chore
- title: 📝 Documentation
labels:
- documentation
- title: ⬆️ Dependencies
labels:
- dependencies
- title: Other Changes
labels:
- "*"
67 changes: 34 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,41 @@ on:
push:
branches:
- main
paths-ignore:
- '**.md'
- 'LICENSE'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- "v[0-9]+.[0-9]+.[0-9]+"
pull_request:
branches:
- main
paths-ignore:
- '**.md'
- 'LICENSE'
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *" # runs every day at 5am UTC

env:
DOCKER_BUILDKIT: 1
DOCKER_NETWORK: ${{ github.run_id }}
DOCKER_NETWORK_ALIAS: nginx-plus-test
DOCKER_NGINX_PLUS: nginx-plus-${{ github.run_id }}
DOCKER_NGINX_PLUS_HELPER: nginx-plus-helper-${{ github.run_id }}

jobs:
concurrency:
group: ${{ github.ref_name }}-ci
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
name: Build Client
runs-on: ubuntu-22.04
permissions:
contents: write
if: ${{ github.event.repository.fork == false }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Determine NGINX Plus version
run: echo "NGINX_PLUS_VERSION=$(cat Makefile | grep -m1 NGINX_PLUS_VERSION | cut -d "=" -f2)" >> $GITHUB_ENV

- name: Switch Repository (Nightly)
if: (github.event_name == 'schedule')
run: |
Expand All @@ -44,52 +47,50 @@ jobs:
sed -i "17i sed -i 's|pkgs|pkgs-test|g' /etc/apt/apt.conf.d/90pkgs-nginx" docker/Dockerfile
sed -i 's|deb https|deb [trusted=yes] https|g' docker/Dockerfile
sed -i 's|\${NGINX_PLUS_VERSION^^}/||g' docker/Dockerfile
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2.9.1

- name: Build Plus Docker Image
uses: docker/build-push-action@v4
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
with:
file: docker/Dockerfile
context: 'docker'
context: "docker"
tags: nginx-plus:${{ env.NGINX_PLUS_VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
secrets: |
"nginx-repo.crt=${{ secrets.NGINX_CRT }}"
"nginx-repo.key=${{ secrets.NGINX_KEY }}"
build-args:
NGINX_PLUS_VERSION=${{ env.NGINX_PLUS_VERSION }}
build-args: NGINX_PLUS_VERSION=${{ env.NGINX_PLUS_VERSION }}

- name: Test Client
if: (github.event_name != 'schedule')
run: make test

- name: Test Client (Nightly)
if: (github.event_name == 'schedule')
run: make test
env:
NGINX_PLUS_VERSION: nightly

release:
name: Release
runs-on: ubuntu-22.04
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: build
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Create/Update Draft
uses: lucacome/draft-release@f6dc37dcdf44be100a649b72c62c628776750190 # v0.2.2
id: release-notes
with:
fetch-depth: 0
- name: Publish Release Notes
uses: release-drafter/release-drafter@v5
with:
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
minor-label: "enhancement"
major-label: "change"
publish: ${{ github.ref_type == 'tag' }}
collapse-after: 50
if: ${{ github.event_name == 'push' }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_COMMUNITY }}
if: ${{ github.ref_type == 'tag' }}
94 changes: 50 additions & 44 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,73 @@
# 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.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main ]
branches:
- main
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches:
- main
schedule:
- cron: '33 16 * * 3'
- cron: "33 16 * * 3" # run every Wednesday at 16:33 UTC

concurrency:
group: ${{ github.ref_name }}-codeql
cancel-in-progress: true

permissions:
contents: read

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
language: ["go"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
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.

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
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
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# 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@v2
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# ✏️ 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
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

#- run: |
# make bootstrap
# make release
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
Loading

0 comments on commit 7485c6b

Please sign in to comment.