diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 99ded4e..3f07e0f 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -6,19 +6,9 @@ on: - "v[0-9]+.[0-9]+.[0-9]+" jobs: - build: - name: Build ${{ matrix.target }} + release: + name: Build and release runs-on: ubuntu-latest - strategy: - matrix: - include: - - target: x86_64-unknown-linux-musl - artifact: encrypted_archive-linux-amd64 - - target: aarch64-unknown-linux-musl - artifact: encrypted_archive-linux-arm64 - - target: x86_64-pc-windows-gnu - artifact: encrypted_archive-windows-amd64.exe - steps: - uses: actions/checkout@v4 @@ -28,83 +18,29 @@ jobs: - name: Install cross run: cargo install cross --git https://github.com/cross-rs/cross - - name: Build release binary - run: cross build --release --target ${{ matrix.target }} + - name: Build linux-amd64 + run: cross build --release --target x86_64-unknown-linux-musl - - name: Rename binary - run: | - src="target/${{ matrix.target }}/release/encrypted_archive" - if [ "${{ matrix.target }}" = "x86_64-pc-windows-gnu" ]; then - src="${src}.exe" - fi - cp "$src" "${{ matrix.artifact }}" + - name: Build linux-arm64 + run: cross build --release --target aarch64-unknown-linux-musl - - name: Generate SHA-256 - run: sha256sum "${{ matrix.artifact }}" > "${{ matrix.artifact }}.sha256" + - name: Build windows-amd64 + run: cross build --release --target x86_64-pc-windows-gnu - - name: Upload artifact - uses: https://gitea.com/actions/upload-artifact@v3 - with: - name: ${{ matrix.artifact }} - path: | - ${{ matrix.artifact }} - ${{ matrix.artifact }}.sha256 - - package-decoders: - name: Package decoders - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Package shell decoder - run: | - cp shell/decode.sh decode.sh - sha256sum decode.sh > decode.sh.sha256 - - - name: Package Kotlin decoder - run: | - cp kotlin/ArchiveDecoder.kt ArchiveDecoder.kt - sha256sum ArchiveDecoder.kt > ArchiveDecoder.kt.sha256 - - - name: Upload shell decoder - uses: https://gitea.com/actions/upload-artifact@v3 - with: - name: decode.sh - path: | - decode.sh - decode.sh.sha256 - - - name: Upload Kotlin decoder - uses: https://gitea.com/actions/upload-artifact@v3 - with: - name: ArchiveDecoder.kt - path: | - ArchiveDecoder.kt - ArchiveDecoder.kt.sha256 - - release: - name: Create release - needs: [build, package-decoders] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Download all artifacts - uses: https://gitea.com/actions/download-artifact@v3 - with: - path: artifacts/ - - - name: Collect release files + - name: Collect release artifacts run: | mkdir -p release - find artifacts/ -type f -exec cp {} release/ \; - ls -la release/ + cp target/x86_64-unknown-linux-musl/release/encrypted_archive release/encrypted_archive-linux-amd64 + cp target/aarch64-unknown-linux-musl/release/encrypted_archive release/encrypted_archive-linux-arm64 + cp target/x86_64-pc-windows-gnu/release/encrypted_archive.exe release/encrypted_archive-windows-amd64.exe + cp kotlin/ArchiveDecoder.kt release/ + cp shell/decode.sh release/ + cd release && sha256sum * > SHA256SUMS - name: Create release uses: https://gitea.com/actions/gitea-release-action@v1 with: files: release/* - sha256sum: false body: | ## encrypted_archive ${{ gitea.ref_name }} @@ -117,5 +53,4 @@ jobs: | `encrypted_archive-windows-amd64.exe` | Windows x86_64 | | `ArchiveDecoder.kt` | Kotlin/Android decoder (source) | | `decode.sh` | POSIX shell decoder (requires OpenSSL) | - - Each binary has a corresponding `.sha256` checksum file. + | `SHA256SUMS` | Checksums for all files | diff --git a/.gitignore b/.gitignore index ea8c4bf..974df11 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +*.jar