|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + name: Build ${{ matrix.name }} |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + include: |
| 18 | + - target: x86_64-unknown-linux-musl |
| 19 | + name: linux-x86_64-musl |
| 20 | + poly: false |
| 21 | + - target: x86_64-unknown-linux-musl |
| 22 | + name: linux-x86_64-musl-poly |
| 23 | + poly: true |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + - uses: actions/setup-python@v5 |
| 27 | + if: matrix.poly |
| 28 | + with: |
| 29 | + python-version: "3.12" |
| 30 | + - uses: dtolnay/rust-toolchain@stable |
| 31 | + with: |
| 32 | + targets: ${{ matrix.target }} |
| 33 | + |
| 34 | + - name: Install musl tools |
| 35 | + run: sudo apt-get update && sudo apt-get install -y musl-tools |
| 36 | + |
| 37 | + - name: Polymorphic prep |
| 38 | + if: matrix.poly |
| 39 | + run: python3 scripts/polymorphic.py |
| 40 | + |
| 41 | + - name: Build |
| 42 | + run: | |
| 43 | + if [ "${{ matrix.poly }}" = "true" ]; then |
| 44 | + RUSTFLAGS="-Ccontrol-flow-guard=no -Cforce-frame-pointers=no" \ |
| 45 | + cargo build --profile poly --target ${{ matrix.target }} |
| 46 | + cp target/${{ matrix.target }}/poly/hidemylogs hidemylogs-${{ matrix.name }} |
| 47 | + else |
| 48 | + cargo build --release --target ${{ matrix.target }} |
| 49 | + cp target/${{ matrix.target }}/release/hidemylogs hidemylogs-${{ matrix.name }} |
| 50 | + fi |
| 51 | +
|
| 52 | + - name: Revert sources |
| 53 | + if: matrix.poly |
| 54 | + run: python3 scripts/polymorphic.py --revert |
| 55 | + |
| 56 | + - name: Checksum |
| 57 | + run: sha256sum hidemylogs-${{ matrix.name }} > hidemylogs-${{ matrix.name }}.sha256 |
| 58 | + |
| 59 | + - name: Upload |
| 60 | + uses: actions/upload-artifact@v4 |
| 61 | + with: |
| 62 | + name: hidemylogs-${{ matrix.name }} |
| 63 | + path: | |
| 64 | + hidemylogs-${{ matrix.name }} |
| 65 | + hidemylogs-${{ matrix.name }}.sha256 |
| 66 | +
|
| 67 | + release: |
| 68 | + name: Create Release |
| 69 | + needs: build |
| 70 | + runs-on: ubuntu-latest |
| 71 | + steps: |
| 72 | + - uses: actions/download-artifact@v4 |
| 73 | + with: |
| 74 | + merge-multiple: true |
| 75 | + |
| 76 | + - name: Generate checksums |
| 77 | + run: cat *.sha256 > checksums.sha256 |
| 78 | + |
| 79 | + - name: Release |
| 80 | + uses: softprops/action-gh-release@v2 |
| 81 | + with: |
| 82 | + name: ${{ github.ref_name }} |
| 83 | + files: | |
| 84 | + hidemylogs-* |
| 85 | + checksums.sha256 |
| 86 | + generate_release_notes: true |
0 commit comments