diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml new file mode 100644 index 0000000..0495b9e --- /dev/null +++ b/.github/workflows/build_release.yml @@ -0,0 +1,36 @@ +name: Build Release + +on: + push: + +env: + CARGO_TERM_COLOR: always + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + rust-build: + if: startsWith(github.ref, 'refs/tags/') + name: Rust Build + runs-on: ubuntu-latest + steps: + - name: Install XCB + run: sudo apt install -y libxcb1-dev libxcb-randr0-dev libxcb-shm0-dev + - uses: actions/checkout@v4 + - name: Enable Caching + uses: Swatinem/rust-cache@v2 + - name: Cargo Build + run: cargo build --release + - name: Configure GPG Key + run: echo -n "$GPG_SIGNING_KEY" | gpg --batch --pinentry-mode loopback --allow-secret-key-import --import + env: + GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} + - name: Sign Release + run: gpg --batch --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" --detach-sign "$GITHUB_WORKSPACE/target/release/i3lockr" + env: + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + - name: Draft Release + uses: softprops/action-gh-release@v2 + with: + files: | + $GITHUB_WORKSPACE/target/release/i3lockr + $GITHUB_WORKSPACE/target/release/i3lockr.sig diff --git a/.github/workflows/rust_ci.yml b/.github/workflows/rust_ci.yml index f38961f..d2491b0 100644 --- a/.github/workflows/rust_ci.yml +++ b/.github/workflows/rust_ci.yml @@ -19,6 +19,8 @@ jobs: fail-fast: false matrix: action: + - command: build + args: --color always - command: fmt args: --all -- --check --color always - command: clippy @@ -33,22 +35,3 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Run Command run: cargo ${{ matrix.action.command }} ${{ matrix.action.args }} - rust-build: - name: Rust Build - runs-on: ubuntu-latest - steps: - - name: Install XCB - run: sudo apt install -y libxcb1-dev libxcb-randr0-dev libxcb-shm0-dev - - uses: actions/checkout@v4 - - name: Enable Caching - uses: Swatinem/rust-cache@v2 - - name: Cargo Build - run: cargo build --release - - name: Configure GPG Key - run: echo -n "$GPG_SIGNING_KEY" | gpg --batch --pinentry-mode loopback --allow-secret-key-import --import - env: - GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} - - name: Sign Release - run: gpg --batch --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" --detach-sign "$GITHUB_WORKSPACE/target/release/i3lockr" - env: - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}