better workflows
This commit is contained in:
parent
3990228403
commit
e6c7e3fb7f
29
.gitea/workflows/build.yaml
Normal file
29
.gitea/workflows/build.yaml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
name: Build .deb
|
||||||
|
|
||||||
|
on: workflow_call
|
||||||
|
|
||||||
|
env:
|
||||||
|
SCCACHE_GHA_ENABLED: "true"
|
||||||
|
RUSTC_WRAPPER: "sccache"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Build-Deb:
|
||||||
|
runs-on: aarch64
|
||||||
|
steps:
|
||||||
|
- name: Run sccache-cache
|
||||||
|
uses: https://github.com/mozilla-actions/sccache-action@v0.0.5
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: "recursive"
|
||||||
|
- name: Build
|
||||||
|
run: "cargo build --release --target=aarch64-unknown-linux-gnu"
|
||||||
|
- name: Build .deb
|
||||||
|
run: "cargo deb --target=aarch64-unknown-linux-gnu"
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: release
|
||||||
|
path: |
|
||||||
|
./target/aarch64-unknown-linux-gnu/debian/*.deb
|
||||||
|
./target/aarch64-unknown-linux-gnu/release/tesla-charge-controller
|
|
@ -1,25 +1,21 @@
|
||||||
name: Build .deb on release
|
name: Build and release .deb
|
||||||
run-name: Building .deb of latest release and adding to apt repo
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "*"
|
- "v[0-9]+.[0-9]+.[0-9]+"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Build-Deb:
|
Build:
|
||||||
|
uses: ./.gitea/workflows/build.yaml
|
||||||
|
|
||||||
|
Release:
|
||||||
runs-on: aarch64
|
runs-on: aarch64
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Download artifacts
|
||||||
uses: actions/checkout@v3
|
uses: actions/download-artifact@v4
|
||||||
with:
|
|
||||||
submodules: "recursive"
|
|
||||||
- name: Build
|
|
||||||
run: "cargo build --release --target=aarch64-unknown-linux-gnu"
|
|
||||||
- name: Build .deb
|
|
||||||
run: "cargo deb --target=aarch64-unknown-linux-gnu"
|
|
||||||
- name: Add .deb to apt repository
|
- name: Add .deb to apt repository
|
||||||
run: "curl --user alex:${{ secrets.PACKAGING_TOKEN }} --upload-file $(ls -t ./target/aarch64-unknown-linux-gnu/debian/*.deb | head -1) https://git.alexjanka.com/api/packages/alex/debian/pool/testing/main/upload"
|
run: "curl --user alex:${{ secrets.PACKAGING_TOKEN }} --upload-file $(ls -t ./release/*.deb | head -1) https://git.alexjanka.com/api/packages/alex/debian/pool/testing/main/upload"
|
||||||
- name: "Release package"
|
- name: "Release package"
|
||||||
id: use-go-action
|
id: use-go-action
|
||||||
uses: https://gitea.com/actions/release-action@main
|
uses: https://gitea.com/actions/release-action@main
|
||||||
|
|
10
.gitea/workflows/pre.yaml
Normal file
10
.gitea/workflows/pre.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
name: Build prerelease .deb
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*-pre"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Build:
|
||||||
|
uses: ./.gitea/workflows/build.yaml
|
Loading…
Reference in a new issue