Skip to content

Commit 7aad73b

Browse files
committed
👷 ci: Add new feature for trusted publisher
1 parent 3c8c3e9 commit 7aad73b

File tree

10 files changed

+39
-51
lines changed

10 files changed

+39
-51
lines changed

.github/scripts/release-pr.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ major=$(echo $new_sdk_version | cut -d '.' -f 1)
1919
branch_name="autobuild-$new_sdk_version"
2020

2121
# https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls#create-a-pull-request
22-
result=$(curl -s -X POST -H "Authorization: token $GH_TOKEN" -d "{\"head\":\"$branch_name\",\"base\":\"master\",\"title\":\"SDK v$new_sdk_version\",\"body\":\"Automatic build of SDK v$new_sdk_version version based on Outscale API $osc_api_version\"}" "https://api.github.com/repos/outscale/osc-sdk-python/pulls")
22+
result=$(curl -s -X POST -H "Authorization: token $GH_TOKEN" -d "{\"head\":\"$branch_name\",\"base\":\"main\",\"title\":\"SDK v$new_sdk_version\",\"body\":\"Automatic build of SDK v$new_sdk_version version based on Outscale API $osc_api_version\"}" "https://api.github.com/repos/outscale/osc-sdk-python/pulls")
2323

2424
errors=$(echo $result | jq .errors)
2525

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ on:
99
jobs:
1010
auto-build:
1111
environment: auto-build
12-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-24.04
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
1515
- name: ⬇️ Install Python
1616
uses: actions/setup-python@v5
1717
with:

.github/workflows/code-check-identified.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Code check On outscale
33
on:
44
pull_request:
55
branches:
6-
- master
6+
- main
77

88
permissions:
99
pull-requests: write
@@ -20,7 +20,7 @@ jobs:
2020
secret_key: ${{ secrets.OSC_SECRET_KEY }}
2121
region: ${{ secrets.OSC_REGION }}
2222
- name: ⬇️ Checkout repository
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@v5
2424
- name: ⬇️ Import Outscale API description
2525
run: make init
2626
- name: ⬇️ Install Python

.github/workflows/code-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ name: Code check Local
33
on:
44
pull_request:
55
branches:
6-
- master
6+
- main
77

88
jobs:
99
code-check:
10-
runs-on: ubuntu-22.04
10+
runs-on: ubuntu-24.04
1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@v5
1313
- name: Import Outscale API description
1414
run: make init
1515
- name: Install Python

.github/workflows/codeql.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: [ "main" ]
66
pull_request:
7-
branches: [ "master" ]
7+
branches: [ "main" ]
88
schedule:
9-
- cron: "33 13 * * 5"
9+
- cron: "37 13 * * 5"
1010

1111
jobs:
1212
analyze:
@@ -20,11 +20,13 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
language: [ python ]
23+
include:
24+
- language: python
25+
- language: actions
2426

2527
steps:
2628
- name: Checkout
27-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
2830

2931
- name: Initialize CodeQL
3032
uses: github/codeql-action/init@v2

.github/workflows/cred-scan.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ name: Credential Scanner
22

33
on:
44
pull_request:
5-
branches: [ master ]
5+
branches: [ main ]
6+
7+
permissions:
8+
contents: read
69

710
jobs:
811
cred-scan:
9-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-latest
1013
steps:
11-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
1215
- name: Scan credentials
13-
uses: outscale-dev/cred-scan@main
16+
uses: outscale/cred-scan@main
1417
with:
1518
scan_path: "./"

.github/workflows/github-sanity-scan.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ name: Github sanity scanner
22

33
on:
44
pull_request:
5-
branches: [ master ]
5+
branches: [ main ]
6+
7+
permissions:
8+
contents: read
69

710
jobs:
811
github-sanity-scan:
9-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-latest
1013
steps:
11-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
1215
- name: Github sanity scanner
1316
uses: outscale/github-sanity-scan@main
1417
with:

.github/workflows/publish.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
name: osc-sdk-python pip publishing
2+
23
on:
34
release:
45
types: [released]
56

7+
permissions:
8+
contents: read
9+
id-token: write
10+
611
jobs:
7-
publish:
12+
build:
13+
runs-on: ubuntu-24.04
814
environment: publish
9-
runs-on: ubuntu-22.04
1015
steps:
11-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1217
- name: Set up Python
1318
uses: actions/setup-python@v5
1419
with:
1520
python-version: '3.x'
1621
- name: Initialize submodules
1722
run: make init
18-
- name: Build & Push packages
19-
run: make upload-package
20-
env:
21-
PIP_TOKEN: ${{ secrets.PIP_TOKEN }}
23+
- name: Build packages
24+
run: make package
25+
- uses: pypa/gh-action-pypi-publish@release/v1

Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ test-int: .venv/ok init
3131
package: .venv/ok init
3232
@./scripts/package.sh
3333

34-
.PHONY: upload-package
35-
upload-package: package
36-
@./scripts/upload_package.sh
37-
3834
.PHONY: osc-api-update
3935
osc-api-update:
4036
cd osc_sdk_python/osc-api/; git fetch; git checkout origin/master; cd ..; git add osc-api

scripts/upload_package.sh

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

0 commit comments

Comments
 (0)