From 6c0a9d68ccb4b759e600ca1fa24f8ace65c68a6d Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Fri, 16 Aug 2024 15:47:09 +0200 Subject: [PATCH] ci: switch from builds.sr.ht manifest to forgejo action workflows Signed-off-by: Christoph Heiss --- .build.yml | 21 ------------------- .editorconfig | 3 +++ .forgejo/workflows/flake.yaml | 21 +++++++++++++++++++ .forgejo/workflows/nightly.yaml | 37 +++++++++++++++++++++++++++++++++ .prettierrc.json | 3 +++ 5 files changed, 64 insertions(+), 21 deletions(-) delete mode 100644 .build.yml create mode 100644 .forgejo/workflows/flake.yaml create mode 100644 .forgejo/workflows/nightly.yaml create mode 100644 .prettierrc.json diff --git a/.build.yml b/.build.yml deleted file mode 100644 index d9fba6a..0000000 --- a/.build.yml +++ /dev/null @@ -1,21 +0,0 @@ -image: archlinux -arch: x86_64 -packages: - - rust - - libxcb -artifacts: - - bwtui/target/release/bwtui -sources: - - https://git.sr.ht/~c8h4/bwtui -environment: - RUSTFLAGS: -D warnings - CARGO_TERM_COLOR: always -tasks: - - test: | - cd bwtui - cargo clippy --no-deps - cargo test --all-features --no-fail-fast - cargo doc --all-features --no-deps - - build: | - cd bwtui - cargo build --release diff --git a/.editorconfig b/.editorconfig index af1c2ff..af9828f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,3 +10,6 @@ trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false + +[*.yaml] +indent_size = 2 diff --git a/.forgejo/workflows/flake.yaml b/.forgejo/workflows/flake.yaml new file mode 100644 index 0000000..60d9fc0 --- /dev/null +++ b/.forgejo/workflows/flake.yaml @@ -0,0 +1,21 @@ +--- +name: flake + +on: + push: + +env: + NIX_CONFIG: 'experimental-features = nix-command flakes' + +jobs: + build: + runs-on: nixos-unstable + steps: + - name: prepare nix container + run: nix-env -iA nixpkgs.nodejs + + - name: checkout repository + uses: actions/checkout@v4 + + - name: run flake check + run: nix flake check -L diff --git a/.forgejo/workflows/nightly.yaml b/.forgejo/workflows/nightly.yaml new file mode 100644 index 0000000..e111bbb --- /dev/null +++ b/.forgejo/workflows/nightly.yaml @@ -0,0 +1,37 @@ +--- +name: nightly build + +on: + push: + branches: + - main + +env: + NIX_CONFIG: 'experimental-features = nix-command flakes' + +jobs: + build: + runs-on: nixos-unstable + steps: + - name: prepare nix container + run: nix-env -iA nixpkgs.nodejs + + - name: checkout repository + uses: actions/checkout@v4 + + - name: run flake check + run: nix flake check -L + + - name: build nightly binary + run: nix build .#bwtui + + - name: upload binary + # v4 has a bug: https://github.com/go-gitea/gitea/issues/31354 + # use v3 until it is fixed + uses: forgejo/upload-artifact@v3 + with: + name: pmon-nightly-${{ env.GITHUB_SHA }} + path: result/bin/bwtui + retention-days: 14 + if-no-files-found: error + overwrite: true diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..544138b --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "singleQuote": true +}