Skip to content

Commit 2e41eee

Browse files
committed
Multiple workflow changes
1 parent bc337be commit 2e41eee

File tree

9 files changed

+140
-120
lines changed

9 files changed

+140
-120
lines changed
Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,51 @@
1-
name: Unit Tests
1+
name: Continuous Integration
22
on:
33
workflow_dispatch: null
44
push:
55
pull_request:
66
jobs:
7+
docker-build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Build the Docker image
12+
run: docker build . --file Dockerfile --tag linode/cli:$(date +%s) --build-arg="github_token=$GITHUB_TOKEN"
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
16+
lint:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: checkout repo
20+
uses: actions/checkout@v4
21+
22+
- name: setup python 3
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.x'
26+
27+
- name: install dependencies
28+
run: make install
29+
30+
- name: run linter
31+
run: make lint
32+
733
unit-tests-on-ubuntu:
834
runs-on: ubuntu-latest
935
strategy:
1036
matrix:
11-
python-version: [ '3.9','3.10','3.11', '3.12' ]
37+
python-version: [ "3.9","3.10","3.11", "3.12", "3.13" ]
1238
steps:
1339
- name: Clone Repository
1440
uses: actions/checkout@v4
1541

16-
- name: Update system packages
17-
run: sudo apt-get update -y
18-
1942
- name: Setup Python
2043
uses: actions/setup-python@v5
2144
with:
2245
python-version: ${{ matrix.python-version }}
2346

2447
- name: Install Python wheel
25-
run: pip install wheel boto3
26-
27-
- name: Update cert
28-
run: pip install certifi -U
29-
30-
- name: Install deps
31-
run: pip install .[dev]
48+
run: pip install -U wheel boto3 certifi
3249

3350
- name: Install Package
3451
run: make install
@@ -47,7 +64,7 @@ jobs:
4764
- name: Setup Python
4865
uses: actions/setup-python@v5
4966
with:
50-
python-version: '3.x'
67+
python-version: "3.x"
5168

5269
- name: Install Python wheel
5370
run: pip install wheel boto3

.github/workflows/codeql.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches: [ "dev", "main" ]
6+
pull_request:
7+
branches: [ "dev", "main" ]
8+
schedule:
9+
- cron: "0 13 * * 5"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
runs-on: ubuntu-latest
15+
permissions:
16+
security-events: write
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- language: python
23+
build-mode: none
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@v3
30+
with:
31+
languages: ${{ matrix.language }}
32+
build-mode: ${{ matrix.build-mode }}
33+
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@v3
36+
with:
37+
category: "/language:${{matrix.language}}"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Dependency review'
2+
on:
3+
pull_request:
4+
branches: [ "dev", "main", "proj/*" ]
5+
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
10+
jobs:
11+
dependency-review:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: 'Checkout repository'
15+
uses: actions/checkout@v4
16+
- name: 'Dependency Review'
17+
uses: actions/dependency-review-action@v4
18+
with:
19+
comment-summary-in-pr: on-failure

.github/workflows/docker-build.yml

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

.github/workflows/publish-pypi.yml

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

.github/workflows/pull-request.yml

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

.github/workflows/release-notify-slack.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
1-
name: OCI Image Publish
1+
name: Release
22
on:
33
workflow_dispatch: null
44
release:
55
types: [ published ]
66
jobs:
7+
notify:
8+
if: github.repository == 'linode/linode-cli'
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Notify Slack - Main Message
12+
id: main_message
13+
uses: slackapi/[email protected]
14+
with:
15+
method: chat.postMessage
16+
token: ${{ secrets.SLACK_BOT_TOKEN }}
17+
payload: |
18+
channel: ${{ secrets.CLI_SLACK_CHANNEL_ID }}
19+
blocks:
20+
- type: section
21+
text:
22+
type: mrkdwn
23+
text: "*New Release Published: _linode-cli_ <${{ github.event.release.html_url }}|${{ github.event.release.tag_name }}> is now live!* :tada:"
24+
725
oci_publish:
826
name: Build and publish the OCI image
927
runs-on: ubuntu-latest
@@ -58,3 +76,37 @@ jobs:
5876
build-args: |
5977
linode_cli_version=${{ steps.cli_version.outputs.result }}
6078
github_token=${{ secrets.GITHUB_TOKEN }}
79+
80+
pypi-release:
81+
runs-on: ubuntu-latest
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v4
85+
86+
- name: Update system packages
87+
run: sudo apt-get update -y
88+
89+
- name: Install make
90+
run: sudo apt-get install -y build-essential
91+
92+
- name: Setup Python
93+
uses: actions/setup-python@v5
94+
with:
95+
python-version: '3.x'
96+
97+
- name: Install Python deps
98+
run: pip install wheel
99+
100+
- name: Install package requirements
101+
run: make requirements
102+
103+
- name: Build the package
104+
run: make build
105+
env:
106+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
LINODE_CLI_VERSION: ${{ github.event.release.tag_name }}
108+
109+
- name: Publish the release artifacts to PyPI
110+
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc # pin@release/v1.12.2
111+
with:
112+
password: ${{ secrets.PYPI_API_TOKEN }}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ build: clean create-version bake
4444

4545
.PHONY: requirements
4646
requirements:
47-
pip3 install --upgrade .[dev,obj]
47+
pip3 install --upgrade ".[dev,obj]"
4848

4949
.PHONY: lint
5050
lint: build

0 commit comments

Comments
 (0)