Skip to content

Commit 8460a36

Browse files
authored
Update workflows (#140)
1 parent 16be5d5 commit 8460a36

15 files changed

+270
-207
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "github-actions"
4-
directory: "/"
3+
- package-ecosystem: github-actions
4+
directory: /
55
schedule:
6-
interval: daily
7-
reviewers:
8-
- "nginxinc/kic"
9-
- package-ecosystem: "docker"
10-
directory: "/docker"
6+
interval: weekly
7+
8+
- package-ecosystem: docker
9+
directory: /docker
1110
schedule:
12-
interval: daily
13-
reviewers:
14-
- "nginxinc/kic"
11+
interval: weekly

.github/labeler.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
change:
2+
- head-branch: ['^change/']
3+
4+
enhancement:
5+
- head-branch: ['^feature/', '^feat/', '^enhancement/', '^enh/']
6+
7+
bug:
8+
- head-branch: ['^fix/', '^bug/']
9+
10+
chore:
11+
- head-branch: ['^chore/']
12+
13+
tests:
14+
- head-branch: ['^tests/', '^test/']
15+
- changed-files: 'tests/**/*'
16+
17+
documentation:
18+
- head-branch: ['^docs/', '^doc/']
19+
- changed-files: '**/*.md'
20+
21+
dependencies:
22+
- head-branch: ['^deps/', '^dep/', '^dependabot/']
23+
- changed-files: ['go.mod', 'go.sum']

.github/release-drafter.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

.github/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- skip changelog
5+
categories:
6+
- title: 💣 Breaking Changes
7+
labels:
8+
- change
9+
- title: 🚀 Features
10+
labels:
11+
- enhancement
12+
- title: 🐛 Bug Fixes
13+
labels:
14+
- bug
15+
- title: 🧪 Tests
16+
labels:
17+
- tests
18+
- title: 🔨 Maintenance
19+
labels:
20+
- chore
21+
- title: 📝 Documentation
22+
labels:
23+
- documentation
24+
- title: ⬆️ Dependencies
25+
labels:
26+
- dependencies
27+
- title: Other Changes
28+
labels:
29+
- "*"

.github/workflows/ci.yml

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,41 @@ on:
44
push:
55
branches:
66
- main
7-
paths-ignore:
8-
- '**.md'
9-
- 'LICENSE'
107
tags:
11-
- 'v[0-9]+.[0-9]+.[0-9]+'
8+
- "v[0-9]+.[0-9]+.[0-9]+"
129
pull_request:
1310
branches:
1411
- main
15-
paths-ignore:
16-
- '**.md'
17-
- 'LICENSE'
1812
schedule:
19-
- cron: '0 5 * * *'
13+
- cron: "0 5 * * *" # runs every day at 5am UTC
2014

2115
env:
22-
DOCKER_BUILDKIT: 1
2316
DOCKER_NETWORK: ${{ github.run_id }}
2417
DOCKER_NETWORK_ALIAS: nginx-plus-test
2518
DOCKER_NGINX_PLUS: nginx-plus-${{ github.run_id }}
2619
DOCKER_NGINX_PLUS_HELPER: nginx-plus-helper-${{ github.run_id }}
2720

28-
jobs:
21+
concurrency:
22+
group: ${{ github.ref_name }}-ci
23+
cancel-in-progress: true
24+
25+
permissions:
26+
contents: read
2927

28+
jobs:
3029
build:
3130
name: Build Client
3231
runs-on: ubuntu-22.04
32+
permissions:
33+
contents: write
3334
if: ${{ github.event.repository.fork == false }}
3435
steps:
3536
- name: Checkout Repository
36-
uses: actions/checkout@v3
37+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
38+
3739
- name: Determine NGINX Plus version
3840
run: echo "NGINX_PLUS_VERSION=$(cat Makefile | grep -m1 NGINX_PLUS_VERSION | cut -d "=" -f2)" >> $GITHUB_ENV
41+
3942
- name: Switch Repository (Nightly)
4043
if: (github.event_name == 'schedule')
4144
run: |
@@ -44,52 +47,50 @@ jobs:
4447
sed -i "17i sed -i 's|pkgs|pkgs-test|g' /etc/apt/apt.conf.d/90pkgs-nginx" docker/Dockerfile
4548
sed -i 's|deb https|deb [trusted=yes] https|g' docker/Dockerfile
4649
sed -i 's|\${NGINX_PLUS_VERSION^^}/||g' docker/Dockerfile
50+
4751
- name: Set up Docker Buildx
48-
uses: docker/setup-buildx-action@v2
52+
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2.9.1
53+
4954
- name: Build Plus Docker Image
50-
uses: docker/build-push-action@v4
55+
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
5156
with:
5257
file: docker/Dockerfile
53-
context: 'docker'
58+
context: "docker"
5459
tags: nginx-plus:${{ env.NGINX_PLUS_VERSION }}
5560
cache-from: type=gha
5661
cache-to: type=gha,mode=max
5762
load: true
5863
secrets: |
5964
"nginx-repo.crt=${{ secrets.NGINX_CRT }}"
6065
"nginx-repo.key=${{ secrets.NGINX_KEY }}"
61-
build-args:
62-
NGINX_PLUS_VERSION=${{ env.NGINX_PLUS_VERSION }}
66+
build-args: NGINX_PLUS_VERSION=${{ env.NGINX_PLUS_VERSION }}
67+
6368
- name: Test Client
6469
if: (github.event_name != 'schedule')
6570
run: make test
71+
6672
- name: Test Client (Nightly)
6773
if: (github.event_name == 'schedule')
6874
run: make test
6975
env:
7076
NGINX_PLUS_VERSION: nightly
7177

72-
release:
73-
name: Release
74-
runs-on: ubuntu-22.04
75-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
76-
needs: build
77-
steps:
78-
- name: Checkout Repository
79-
uses: actions/checkout@v3
78+
- name: Create/Update Draft
79+
uses: lucacome/draft-release@f6dc37dcdf44be100a649b72c62c628776750190 # v0.2.2
80+
id: release-notes
8081
with:
81-
fetch-depth: 0
82-
- name: Publish Release Notes
83-
uses: release-drafter/release-drafter@v5
84-
with:
85-
publish: true
86-
env:
87-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
minor-label: "enhancement"
83+
major-label: "change"
84+
publish: ${{ github.ref_type == 'tag' }}
85+
collapse-after: 50
86+
if: ${{ github.event_name == 'push' }}
87+
8888
- name: Run GoReleaser
89-
uses: goreleaser/goreleaser-action@v4
89+
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0
9090
with:
9191
version: latest
92-
args: release --rm-dist
92+
args: release --clean
9393
env:
9494
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9595
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_COMMUNITY }}
96+
if: ${{ github.ref_type == 'tag' }}

.github/workflows/codeql-analysis.yml

Lines changed: 50 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,73 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
121
name: "CodeQL"
132

143
on:
154
push:
16-
branches: [ main ]
5+
branches:
6+
- main
177
pull_request:
188
# The branches below must be a subset of the branches above
19-
branches: [ main ]
9+
branches:
10+
- main
2011
schedule:
21-
- cron: '33 16 * * 3'
12+
- cron: "33 16 * * 3" # run every Wednesday at 16:33 UTC
13+
14+
concurrency:
15+
group: ${{ github.ref_name }}-codeql
16+
cancel-in-progress: true
17+
18+
permissions:
19+
contents: read
2220

2321
jobs:
2422
analyze:
2523
name: Analyze
26-
runs-on: ubuntu-latest
24+
runs-on: ubuntu-22.04
25+
permissions:
26+
actions: read
27+
contents: read
28+
security-events: write
2729

2830
strategy:
2931
fail-fast: false
3032
matrix:
31-
language: [ 'go' ]
32-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
33-
# Learn more:
34-
# 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
33+
language: ["go"]
34+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
35+
# Use only 'java' to analyze code written in Java, Kotlin or both
36+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
3538

3639
steps:
37-
- name: Checkout repository
38-
uses: actions/checkout@v3
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
3951

40-
# Initializes the CodeQL tools for scanning.
41-
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v2
43-
with:
44-
languages: ${{ matrix.language }}
45-
# If you wish to specify custom queries, you can do so here or in a config file.
46-
# By default, queries listed here will override any specified in a config file.
47-
# Prefix the list here with "+" to use these queries and those in the config file.
48-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
# 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
53+
# queries: security-extended,security-and-quality
4954

50-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
51-
# If this step fails, then you should remove it and run the build manually (see below)
52-
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v2
55+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
56+
# If this step fails, then you should remove it and run the build manually (see below)
57+
- name: Autobuild
58+
uses: github/codeql-action/autobuild@v2
5459

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

58-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
59-
# and modify them (or add more) to build your code if your project
60-
# uses a compiled language
63+
# If the Autobuild fails above, remove it and uncomment the following three lines.
64+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
6165

62-
#- run: |
63-
# make bootstrap
64-
# make release
66+
# - run: |
67+
# echo "Run, Build Application using script"
68+
# ./location_of_script_within_repo/buildscript.sh
6569

66-
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v2
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v2
72+
with:
73+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)