diff --git a/.github/workflows/build-api.yml b/.github/workflows/build-api.yml index 6a9eee2..0b18874 100644 --- a/.github/workflows/build-api.yml +++ b/.github/workflows/build-api.yml @@ -1,6 +1,7 @@ name: Build and test api on: + workflow_dispatch: push: branches: [ main, develop ] pull_request: @@ -10,8 +11,14 @@ env: CARGO_TERM_COLOR: always jobs: - + build: + + defaults: + run: + shell: bash + working-directory: mediarepo-api + strategy: fail-fast: false matrix: @@ -19,11 +26,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - - name: switch working directory - run: cd mediarepo-api + if: ${{ !env.ACT }} - name: Cache build data + if: ${{ !env.ACT }} uses: actions/cache@v2 with: path: | @@ -37,8 +43,8 @@ jobs: uses: knicknic/os-specific-run@v1.0.3 with: linux: | - sudo apt update - sudo apt install libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev -y + sudo apt-get update + DEBIAN_FRONTEND=noninteractive sudo apt-get install libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev -y - name: Build run: cargo build diff --git a/.github/workflows/build-daemon.yml b/.github/workflows/build-daemon.yml index 7960db3..dd5be49 100644 --- a/.github/workflows/build-daemon.yml +++ b/.github/workflows/build-daemon.yml @@ -1,6 +1,7 @@ name: Build daemon on: + workflow_dispatch: push: branches: [ main, develop ] pull_request: @@ -12,6 +13,12 @@ env: jobs: build: + + defaults: + run: + shell: bash + working-directory: mediarepo-daemon + strategy: fail-fast: false matrix: @@ -19,11 +26,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - - name: switch working directory - run: cd mediarepo-daemon + if: ${{ !env.ACT }} - name: Cache build data + if: ${{ !env.ACT }} uses: actions/cache@v2 with: path: | @@ -37,6 +43,7 @@ jobs: run: cargo build --release --no-default-features - name: Upload artifacts + if: ${{ !env.ACT }} uses: actions/upload-artifact@v2 with: name: mediarepo-daemon-${{ runner.os }} diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index a5841bb..63d65ab 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -5,11 +5,19 @@ on: push: branches: - main - - github-actions + - develop + pull_request: + branches: + - main + - develop jobs: - build-debug: + build-debug: + defaults: + run: + shell: bash + working-directory: mediarepo-ui runs-on: ${{ matrix.os }} strategy: @@ -19,11 +27,10 @@ jobs: steps: - uses: actions/checkout@v2 - - - name: switch working directory - run: cd mediarepo-ui + if: ${{ !env.ACT }} - name: Cache Dependencies + if: ${{ !env.ACT }} id: cache-dependencies uses: actions/cache@v2 with: @@ -58,13 +65,14 @@ jobs: uses: knicknic/os-specific-run@v1.0.3 with: linux: | - sudo apt update - sudo apt install libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev -y + sudo apt-get update + DEBIAN_FRONTEND=noninteractive sudo apt-get install libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev -y - name: Build project run: cargo tauri build --debug - name: Upload artifacts + if: ${{ !env.ACT }} uses: actions/upload-artifact@v2 with: name: mediarepo-ui-${{ runner.os }}-debug @@ -74,6 +82,11 @@ jobs: build-release: + defaults: + run: + shell: bash + working-directory: mediarepo-ui + runs-on: ${{ matrix.os }} strategy: @@ -83,11 +96,10 @@ jobs: steps: - uses: actions/checkout@v2 - - - name: switch working directory - run: cd mediarepo-ui + if: ${{ !env.ACT }} - name: Cache Dependencies + if: ${{ !env.ACT }} id: cache-dependencies uses: actions/cache@v2 with: @@ -122,13 +134,14 @@ jobs: uses: knicknic/os-specific-run@v1.0.3 with: linux: | - sudo apt update - sudo apt install libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev -y + sudo apt-get update + DEBIAN_FRONTEND=noninteractive sudo apt-get install libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev -y - name: Build project run: cargo tauri build - name: Upload artifacts + if: ${{ !env.ACT }} uses: actions/upload-artifact@v2 with: name: mediarepo-ui-${{ runner.os }}-release diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..84413b0 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,50 @@ +name: Run checks on all projects + +on: + workflow_dispatch: + push: + branches: [ main, develop ] + pull_request: + branches: [ main, develop ] + +env: + CARGO_TERM_COLOR: always + +jobs: + + build: + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + if: ${{ !env.ACT }} + + - name: Install OS-specific dependencies + uses: knicknic/os-specific-run@v1.0.3 + with: + linux: | + sudo apt-get update + DEBIAN_FRONTEND=noninteractive sudo apt-get install libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev -y + + - name: Check api + working-directory: mediarepo-api + run: cargo check --all-features + + - name: Check daemon + working-directory: mediarepo-daemon + run: cargo check --no-default-features + + - name: Install UI dependencies + working-directory: mediarepo-ui + run: | + npm i -g yarn + npm i -g @angular/cli + yarn install + + - name: Lint ui frontend + working-directory: mediarepo-ui + run: yarn lint \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d7657c6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +name: Create pre-release + +on: + push: + branches: + - "master" +jobs: + pre-release: + name: Pre Release + runs-on: ubuntu-latest + steps: + - uses: marvinpinto/action-automatic-releases@latest + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + automatic_release_tag: latest + prerelease: true + title: Latest Pre-Release + files: | + LICENSE \ No newline at end of file