feat: Change CI logic
This commit is contained in:
@@ -6,19 +6,9 @@ on:
|
|||||||
- "v[0-9]+.[0-9]+.[0-9]+"
|
- "v[0-9]+.[0-9]+.[0-9]+"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
release:
|
||||||
name: Build ${{ matrix.target }}
|
name: Build and release
|
||||||
runs-on: ubuntu-latest
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -28,83 +18,29 @@ jobs:
|
|||||||
- name: Install cross
|
- name: Install cross
|
||||||
run: cargo install cross --git https://github.com/cross-rs/cross
|
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||||
|
|
||||||
- name: Build release binary
|
- name: Build linux-amd64
|
||||||
run: cross build --release --target ${{ matrix.target }}
|
run: cross build --release --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
- name: Rename binary
|
- name: Build linux-arm64
|
||||||
run: |
|
run: cross build --release --target aarch64-unknown-linux-musl
|
||||||
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: Generate SHA-256
|
- name: Build windows-amd64
|
||||||
run: sha256sum "${{ matrix.artifact }}" > "${{ matrix.artifact }}.sha256"
|
run: cross build --release --target x86_64-pc-windows-gnu
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Collect release artifacts
|
||||||
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
|
|
||||||
run: |
|
run: |
|
||||||
mkdir -p release
|
mkdir -p release
|
||||||
find artifacts/ -type f -exec cp {} release/ \;
|
cp target/x86_64-unknown-linux-musl/release/encrypted_archive release/encrypted_archive-linux-amd64
|
||||||
ls -la release/
|
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
|
- name: Create release
|
||||||
uses: https://gitea.com/actions/gitea-release-action@v1
|
uses: https://gitea.com/actions/gitea-release-action@v1
|
||||||
with:
|
with:
|
||||||
files: release/*
|
files: release/*
|
||||||
sha256sum: false
|
|
||||||
body: |
|
body: |
|
||||||
## encrypted_archive ${{ gitea.ref_name }}
|
## encrypted_archive ${{ gitea.ref_name }}
|
||||||
|
|
||||||
@@ -117,5 +53,4 @@ jobs:
|
|||||||
| `encrypted_archive-windows-amd64.exe` | Windows x86_64 |
|
| `encrypted_archive-windows-amd64.exe` | Windows x86_64 |
|
||||||
| `ArchiveDecoder.kt` | Kotlin/Android decoder (source) |
|
| `ArchiveDecoder.kt` | Kotlin/Android decoder (source) |
|
||||||
| `decode.sh` | POSIX shell decoder (requires OpenSSL) |
|
| `decode.sh` | POSIX shell decoder (requires OpenSSL) |
|
||||||
|
| `SHA256SUMS` | Checksums for all files |
|
||||||
Each binary has a corresponding `.sha256` checksum file.
|
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
/target
|
/target
|
||||||
|
*.jar
|
||||||
|
|||||||
Reference in New Issue
Block a user