From bb243c5c8d592b50fae5963d88353ed87e1a03f6 Mon Sep 17 00:00:00 2001 From: fengyc Date: Sat, 20 Jul 2024 02:08:43 +0000 Subject: [PATCH] ci: update github action --- .devcontainer/devcontainer.json | 31 +++++++++++++++++++++++++++++++ .github/dependabot.yml | 12 ++++++++++++ .github/workflows/build-gnu.yml | 13 +++++-------- .github/workflows/build-musl.yml | 15 +++++++-------- .github/workflows/master.yml | 9 +++++++++ .github/workflows/release.yml | 9 +++++++++ 6 files changed, 73 insertions(+), 16 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/dependabot.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f8fff10 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/rust +{ + "name": "Rust", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/rust:1-1-bullseye" + + // Use 'mounts' to make the cargo cache persistent in a Docker Volume. + // "mounts": [ + // { + // "source": "devcontainer-cargo-cache-${devcontainerId}", + // "target": "/usr/local/cargo", + // "type": "volume" + // } + // ] + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "rustc --version", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f33a02c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for more information: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# https://containers.dev/guide/dependabot + +version: 2 +updates: + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/.github/workflows/build-gnu.yml b/.github/workflows/build-gnu.yml index 4295ba1..1d11260 100644 --- a/.github/workflows/build-gnu.yml +++ b/.github/workflows/build-gnu.yml @@ -116,12 +116,9 @@ jobs: with: name: gnu-${{ matrix.target }} path: | - target - !target/release - !target/**/.fingerprint - !target/**/*.d - !target/**/build - !target/**/deps - !target/**/examples - !target/**/incremental + target/**/*.deb + target/**/*.rpm + target/**/pisugar-server + target/**/pisugar-poweroff + target/**/pisugar-programmer if-no-files-found: warn diff --git a/.github/workflows/build-musl.yml b/.github/workflows/build-musl.yml index b4f34b4..c073c01 100644 --- a/.github/workflows/build-musl.yml +++ b/.github/workflows/build-musl.yml @@ -85,15 +85,14 @@ jobs: # Upload artifact - name: Upload artifact uses: actions/upload-artifact@v3 + env: + target: ${{ matrix.target }} with: name: musl-${{ matrix.target }} path: | - target - !target/release - !target/**/.fingerprint - !target/**/*.d - !target/**/build - !target/**/deps - !target/**/examples - !target/**/incremental + target/**/*.deb + target/**/*.rpm + target/**/pisugar-server + target/**/pisugar-poweroff + target/**/pisugar-programmer if-no-files-found: warn diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index a24f9e0..a20b168 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -48,6 +48,14 @@ jobs: with: name: pisugar-all + - name: Create archives + run: | + mkdir -p archives + cp -R target/* archives/ + cp scripts/*.sh archives/ + cp scripts/aur/*.tar.gz archives/ + tar -czf archives.tar.gz archives + # Development Release - uses: "marvinpinto/action-automatic-releases@latest" with: @@ -57,6 +65,7 @@ jobs: prerelease: true draft: false files: | + archives.tar.gz target/**/*.deb target/**/*.rpm scripts/*.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b93bb55..9c7c8b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,12 +43,21 @@ jobs: with: name: pisugar-all + - name: Create archives + run: | + mkdir -p archives + cp -R target/* archives/ + cp scripts/*.sh archives/ + cp scripts/aur/*.tar.gz archives/ + tar -czf archives.tar.gz archives + # Upload artifact - name: Upload artifacts uses: actions/upload-artifact@v2 with: name: pisugar-artifacts path: | + archives.tar.gz target/**/*.deb target/**/*.rpm scripts/*.sh