diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 5a0aebc..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,139 +0,0 @@ -variables: - RUST_IMAGE: "rust:latest" - NODE_IMAGE: "node:lts" - CARGO_HOME: $CI_PROJECT_DIR/cargo - -stages: - - lint - - build - - test - - release - -cache: - key: ${CI_COMMIT_REF_SLUG} - paths: - - target - - cargo - - webui/node_modules - -lint:backend: - stage: lint - image: $RUST_IMAGE - script: - - rustup component add clippy - - make backend_lint - rules: - - changes: - - migrations/**/* - - src/**/* - - Cargo.lock - - Makefile - allow_failure: true - -lint:backend_no_default_features: - stage: lint - image: $RUST_IMAGE - script: - - rustup component add clippy - - make backend_lint_no_default - rules: - - changes: - - migrations/**/* - - src/**/* - - Cargo.lock - - Makefile - allow_failure: true - -lint:frontend: - stage: lint - image: $NODE_IMAGE - script: - - node --version && npm --version - - make frontend_lint - rules: - - allow_failure: true - -lint:frontend_lib: - stage: lint - image: $NODE_IMAGE - script: - - node --version && npm --version - - make frontend_lib_lint - rules: - - allow_failure: true - -build:backend: - stage: build - image: $RUST_IMAGE - script: - - rustc --version && cargo --version - - make backend - artifacts: - paths: - - target/release/upend - expire_in: 1 day - only: - changes: - - migrations/**/* - - src/**/* - - Cargo.lock - - Makefile - -build:frontend: - stage: build - image: $NODE_IMAGE - script: - - node --version && npm --version - - make frontend - artifacts: - paths: - - webui/dist - - tools/upend_js - expire_in: 1 day - only: - changes: - - webui/**/* - - Makefile - -test:backend: - stage: test - image: $RUST_IMAGE - script: - - make backend_test - only: - changes: - - migrations/**/* - - src/**/* - - Cargo.lock - - Makefile - -test:backend_no_default_features: - stage: test - image: $RUST_IMAGE - script: - - make backend_test_no_default - only: - changes: - - migrations/**/* - - src/**/* - - Cargo.lock - - Makefile - allow_failure: true # remove at v1.0 - -package: - stage: release - image: $RUST_IMAGE - before_script: - - cd /tmp - - wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage - - chmod +x linuxdeploy-x86_64.AppImage - - ./linuxdeploy-x86_64.AppImage --appimage-extract - - ln -s $PWD/squashfs-root/AppRun /usr/local/bin/linuxdeploy-x86_64.AppImage - - cd - - script: - - make package - artifacts: - paths: - - ./*.AppImage - only: - - tags diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..306304b --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,112 @@ +pipeline: + prepare:task: + image: rust:latest + commands: + - mkdir .ci_tmp + - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b .ci_tmp + + build:backend: + group: build + image: rust:latest + commands: + - rustc --version && cargo --version + - ./.ci_tmp/task build:backend + # volumes: + # - rust_registry:/usr/local/cargo + when: + path: + - migrations/**/* + - src/**/* + - Cargo.lock + - Taskfile.yml + + build:frontend: + group: build + image: node:lts + commands: + - node --version && npm --version + - ./.ci_tmp/task build:frontend + when: + path: + - webui/**/* + - Taskfile.yml + + lint:backend: + group: lint + image: rust:latest + commands: + - rustup component add clippy + - ./.ci_tmp/task lint:backend + - git status -vvv + # volumes: + # - rust_registry:/usr/local/cargo + when: + path: + - migrations/**/* + - src/**/* + - Cargo.lock + - Taskfile.yml + + lint:frontend: + group: lint + image: node:lts + commands: + - node --version && npm --version + - ./.ci_tmp/task lint:frontend + + lint:jslib: + group: lint + image: node:lts + commands: + - node --version && npm --version + - ./.ci_tmp/task lint:jslib + + lint:webext: + group: lint + image: node:lts + commands: + - node --version && npm --version + - ./.ci_tmp/task lint:webext + + test:backend: + group: test + image: rust:latest + commands: + - curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C /usr/local/cargo/bin + - ./.ci_tmp/task test:backend + # volumes: + # - rust_registry:/usr/local/cargo + when: + path: + - migrations/**/* + - src/**/* + - Cargo.lock + - Taskfile.yml + + package: + group: release + image: rust:latest + commands: + - cd ./.ci_tmp/ + - wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage + - chmod +x linuxdeploy-x86_64.AppImage + - ./linuxdeploy-x86_64.AppImage --appimage-extract + - ln -s $PWD/squashfs-root/AppRun /usr/local/bin/linuxdeploy-x86_64.AppImage + - cd - + - git status -vvv + - ./.ci_tmp/task package + when: + event: [tag] + + publish: + image: woodpeckerci/plugin-gitea-release + settings: + base_url: https://git.thm.place + files: + - "*.AppImage" + checksum: sha512 + api_key: + from_secret: API_KEY + target: main + when: + event: [tag] diff --git a/Taskfile.yml b/Taskfile.yml index 944b4ab..709fee8 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -11,20 +11,18 @@ tasks: package: cmds: - - task:clean - - task:default - rm -fr dist - linuxdeploy-x86_64.AppImage --appdir dist - - cp target/release/upend dist/usr/bin/upend + - cp target/release/upend-cli dist/usr/bin/upend - cp -r webui/dist dist/usr/bin/webui - cp assets/upend.png dist/usr/share/icons/upend.png - linuxdeploy-x86_64.AppImage --appdir dist -d upend.desktop --output appimage vars: VERSION: - sh: grep '^version' Cargo.toml|grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') + sh: grep '^version' Cargo.toml|grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' lint: - deps: [lint:frontend, lint:backend, lint:webext] + deps: [lint:frontend, lint:backend, lint:jslib, lint:webext] lint:frontend: dir: webui @@ -37,9 +35,21 @@ tasks: - yarn lint lint:backend: + sources: + - ./**/Cargo.toml + - ./**/*.rs cmds: - cargo clippy --workspace + lint:jslib: + deps: [build:jslib] + dir: tools/upend_js + sources: + - ./*.ts + - ./package.lock + cmds: + - yarn lint + lint:webext: dir: webext deps: [setup:webext] @@ -53,6 +63,9 @@ tasks: deps: [test:backend] test:backend: + sources: + - ./**/Cargo.toml + - ./**/*.rs cmds: - cargo nextest run --workspace