Skip to content

Commit 1882ff1

Browse files
committed
feat; update CI
1 parent a7407f7 commit 1882ff1

File tree

4 files changed

+90
-3
lines changed

4 files changed

+90
-3
lines changed

.github/workflows/new_version.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Create release
2+
on:
3+
workflow_dispatch:
4+
5+
permissions:
6+
contents: write
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
submodules: recursive
16+
fetch-depth: 0
17+
token: ${{secrets.GIT_PUSH_TOKEN}}
18+
- name: Create release commit
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install --no-install-recommends -y git-buildpackage
22+
export DEBEMAIL="[email protected]"
23+
export DEBFULLNAME='"Radxa Computer Co., Ltd"'
24+
git config user.name "github-actions[bot]"
25+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
26+
make dch
27+
- name: Test
28+
run: |
29+
sudo apt-get build-dep --no-install-recommends -y .
30+
make all test deb
31+
- name: Push
32+
run: |
33+
git push

.github/workflows/release.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,26 @@ on:
66

77
jobs:
88
build:
9-
runs-on: ubuntu-22.04
9+
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v4
1313
with:
1414
submodules: recursive
1515
fetch-depth: 0
16+
- name: pre-commit check
17+
run: |
18+
pip install pre-commit
19+
if ! pre-commit run --all-files --show-diff-on-failure
20+
then
21+
echo ''
22+
echo '=== Code style issue detected! ==='
23+
echo 'Suggest changes are listed above.'
24+
echo 'Please install pre-commit and run `pre-commit run --all-files` to fix it.'
25+
echo 'Strongly recommended to run `pre-commit install` to catch issues before pushing.'
26+
echo 'You can learn more abour pre-commit from https://pre-commit.com/'
27+
exit 1
28+
fi
1629
- name: Test
1730
run: |
1831
make test
@@ -31,7 +44,7 @@ jobs:
3144
path: |
3245
${{ env.artifacts_path }}/*.deb
3346
release:
34-
runs-on: ubuntu-22.04
47+
runs-on: ubuntu-latest
3548
needs: build
3649
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'main' }}
3750
steps:
@@ -82,3 +95,10 @@ jobs:
8295
## Changelog for ${{ env.version }}
8396
${{ env.changes }}
8497
append_body: true
98+
- name: Update Test repos
99+
if: env.distro != 'UNRELEASED'
100+
uses: radxa-repo/update-repo-action@main
101+
with:
102+
test-repo: true
103+
token: ${{ secrets.RADXA_APT_TEST_REPO_TOKEN }}
104+

.pre-commit-config.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
repos:
2+
- repo: https://github.com/detailyang/pre-commit-shell
3+
rev: v1.0.6
4+
hooks:
5+
- id: shell-lint
6+
args: [-x]
7+
- repo: https://github.com/pre-commit/mirrors-prettier
8+
rev: v3.0.3
9+
hooks:
10+
- id: prettier
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
12+
rev: v4.4.0
13+
hooks:
14+
- id: check-added-large-files
15+
args: [--maxkb=2048]
16+
- id: check-case-conflict
17+
- id: check-json
18+
- id: check-merge-conflict
19+
- id: check-yaml
20+
- id: end-of-file-fixer
21+
- id: fix-byte-order-marker
22+
- id: mixed-line-ending
23+
- id: pretty-format-json
24+
args: [--autofix, --no-ensure-ascii]
25+
- id: trailing-whitespace
26+
args: [--markdown-linebreak-ext=md]
27+
- repo: https://github.com/pre-commit/mirrors-prettier
28+
rev: v3.0.3
29+
hooks:
30+
- id: prettier

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,12 @@ clean-deb:
6767
#
6868
.PHONY: dch
6969
dch: debian/changelog
70-
gbp dch --debian-branch=main
70+
EDITOR=true gbp dch --commit --debian-branch=main --release --dch-opt=--upstream
7171

7272
.PHONY: deb
7373
deb: debian
7474
debuild --no-lintian --lintian-hook "lintian --fail-on error,warning --suppress-tags bad-distribution-in-changes-file -- %p_%v_*.changes" --no-sign -b
75+
76+
.PHONY: release
77+
release:
78+
gh workflow run .github/workflows/new_version.yml

0 commit comments

Comments
 (0)