diff --git a/.github/workflows/build-i3.yml b/.github/workflows/build-i3.yml new file mode 100644 index 0000000..9fabf9d --- /dev/null +++ b/.github/workflows/build-i3.yml @@ -0,0 +1,39 @@ +name: build + +on: [push] + +jobs: + check: + name: Check + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v1 + with: + ref: i3 + + - name: Cargo check + run: cargo check --verbose + + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v1 + with: + ref: i3 + + - name: Cargo test + run: cargo test --verbose + + build: + name: Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + with: + ref: i3 + - name: Build + run: cargo build --verbose diff --git a/.github/workflows/release-i3.yml b/.github/workflows/release-i3.yml new file mode 100644 index 0000000..aeee8f2 --- /dev/null +++ b/.github/workflows/release-i3.yml @@ -0,0 +1,106 @@ +name: release + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + check: + name: Check + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v1 + with: + ref: i3 + + - name: Cargo check + run: cargo check --verbose + + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v1 + with: + ref: i3 + + - name: Cargo test + run: cargo test --verbose + + build: + name: Build + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v1 + with: + ref: i3 + + - name: Build + run: cargo build --verbose + + release-build: + name: Release Build + runs-on: ubuntu-latest + needs: [check, test, build] + + steps: + - name: Checkout + uses: actions/checkout@v1 + with: + ref: i3 + + - name: Build Release + run: cargo build --release --verbose + + - name: Strip unnecessary symbols + run: strip ./target/release/i3-alttab + + - name: Upload build artifact + uses: actions/upload-artifact@v1 + with: + name: binary + path: ./target/release/i3-alttab + + release: + name: Release + runs-on: ubuntu-latest + needs: [release-build] + + steps: + - name: Download artifact + uses: actions/download-artifact@v1 + with: + name: binary + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + # - name: Print tree + # shell: bash + # run: | + # echo HELLO + # tree -CAhF --dirsfirst + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: binary/i3-alttab + asset_name: i3-alttab + asset_content_type: application/octet-stream diff --git a/Cargo.toml b/Cargo.toml index 28b18d1..13aac59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sway-alttab" -description = "Simple Alt-Tab daemon for SwayWM. Switches back to previous focused window on SIGUSR1" +description = "Simple Alt-Tab daemon for SwayWM/i3. Switches back to previous focused window on SIGUSR1" version = "1.1.2" authors = ["Govind KP "] repository = "https://github.com/reisub0/sway-alttab"