From 4778998493724b8b39b4b953a74b3c273ea89bab Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Fri, 24 Nov 2023 16:03:04 +0300 Subject: [PATCH 1/3] Add CI jobs --- .github/dependabot.yml | 30 ++++++++++++++ .github/release-drafter.yml | 41 ++++++++++++++++++ .github/workflows/release.yml | 15 +++++++ .github/workflows/warp.yml | 78 +++++++++++++++++++++++++++++++++++ 4 files changed, 164 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/warp.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7e303cc --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,30 @@ +version: 2 +updates: + - package-ecosystem: docker + directory: '/.docker/' + schedule: + interval: daily + open-pull-requests-limit: 10 + labels: + - 'type: dependencies' + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'daily' + open-pull-requests-limit: 10 + labels: + - 'type: dependencies' + - package-ecosystem: 'gitsubmodule' + directory: '/' + schedule: + interval: 'daily' + open-pull-requests-limit: 10 + labels: + - 'type: dependencies' + - package-ecosystem: 'cargo' + directory: '/' + schedule: + interval: 'daily' + open-pull-requests-limit: 10 + labels: + - 'type: dependencies' \ No newline at end of file diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..89ca903 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,41 @@ +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' +template: | + # What's Changed + + $CHANGES + + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION +categories: + - title: '⚠ Breaking Changes' + label: 'type: breaking' + - title: 'πŸš€New Features' + label: 'type: feature' + - title: '🐜 Bug Fixes' + label: 'type: bug' + - title: '🧰 Maintenance' + label: 'type: maintenance' + - title: 'πŸ“– Documentation' + label: 'type: docs' + - title: 'Other changes' + - title: '⬆ Version Upgrades' + label: 'type: dependencies' + collapse-after: 10 + +version-resolver: + major: + labels: + - 'type: breaking' + minor: + labels: + - 'type: feature' + patch: + labels: + - 'type: bug' + - 'type: maintenance' + - 'type: docs' + - 'type: dependencies' + - 'type: security' + +exclude-labels: + - 'skip-changelog' \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f048221 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,15 @@ +name: Create a release draft + +on: + push: + branches: [ main ] + +jobs: + update_release_draft: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: release-drafter/release-drafter@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/warp.yml b/.github/workflows/warp.yml new file mode 100644 index 0000000..07bddf4 --- /dev/null +++ b/.github/workflows/warp.yml @@ -0,0 +1,78 @@ +name: CI for .docker/pulseaudio + +on: + pull_request: + schedule: + - cron: 0 0 * * * # At the end of everyday + push: + branches: [main] + tags: + - v*.*.* + release: + types: [published] + +# Cancel previous runs of the same workflow on the same branch. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-warp: + # defaults: + # run: + # working-directory: moq-server + strategy: + fail-fast: false + matrix: + settings: + - host: ubuntu-20.04 + target: x86_64-unknown-linux-gnu + bundles: appimage + asset_name: warp-ubuntu-amd64 + + name: Warp for ${{ matrix.settings.target }} + runs-on: ${{ matrix.settings.host }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Install Rust + id: toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.settings.target }} + toolchain: stable + components: clippy, rustfmt + + - name: Cache Rust Dependencies + uses: Swatinem/rust-cache@v2 + with: + save-if: false + prefix-key: 'v0-rust-deps' + shared-key: ${{ matrix.settings.target }} + + - name: Build + run: cargo build --target ${{ matrix.settings.target }} --manifest-path ./moq-pub/Cargo.toml --release + + - name: Copy and rename artifacts (Linux) + if: ${{ matrix.settings.host == 'ubuntu-20.04' }} + run: | + cp target/${{ matrix.settings.target }}/release/moq-pub ./warp + + - name: Publish artifacts (${{ matrix.settings.host }}) + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.settings.asset_name }} + path: ./moq-server/warp + if-no-files-found: error + retention-days: 5 + + - name: Publish release for (${{ matrix.settings.host }}) + uses: svenstaro/upload-release-action@2.7.0 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./moq-server/warp + asset_name: ${{ matrix.settings.asset_name }} + tag: ${{ github.ref }} \ No newline at end of file From 5ce2de20351bd022ce9e965fe3c6b2e4abdb61e6 Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Fri, 24 Nov 2023 16:56:35 +0300 Subject: [PATCH 2/3] Fi for release --- .github/workflows/warp.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/warp.yml b/.github/workflows/warp.yml index 07bddf4..5cc6f23 100644 --- a/.github/workflows/warp.yml +++ b/.github/workflows/warp.yml @@ -57,11 +57,11 @@ jobs: run: cargo build --target ${{ matrix.settings.target }} --manifest-path ./moq-pub/Cargo.toml --release - name: Copy and rename artifacts (Linux) - if: ${{ matrix.settings.host == 'ubuntu-20.04' }} run: | cp target/${{ matrix.settings.target }}/release/moq-pub ./warp - name: Publish artifacts (${{ matrix.settings.host }}) + if: ${{ github.event_name != 'release' }} uses: actions/upload-artifact@v3 with: name: ${{ matrix.settings.asset_name }} @@ -70,6 +70,7 @@ jobs: retention-days: 5 - name: Publish release for (${{ matrix.settings.host }}) + if: ${{ github.event_name == 'release' }} uses: svenstaro/upload-release-action@2.7.0 with: repo_token: ${{ secrets.GITHUB_TOKEN }} From 84782a35fa888094170299132b680d09b1a6ed49 Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Fri, 24 Nov 2023 16:57:47 +0300 Subject: [PATCH 3/3] Rename --- .github/workflows/warp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/warp.yml b/.github/workflows/warp.yml index 5cc6f23..5965614 100644 --- a/.github/workflows/warp.yml +++ b/.github/workflows/warp.yml @@ -1,4 +1,4 @@ -name: CI for .docker/pulseaudio +name: CI for warp binary on: pull_request: