mirror of
https://github.com/muun/recovery.git
synced 2025-11-12 06:50:18 -05:00
Update project structure and build process
This commit is contained in:
40
.github/workflows/pr.yml
vendored
40
.github/workflows/pr.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-12, macos-11]
|
||||
os: [macos-13, macos-14, macos-15]
|
||||
arch: [amd64, arm64]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
@@ -19,32 +19,32 @@ jobs:
|
||||
out: recovery-tool-${{ matrix.os }}-${{ matrix.arch }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
|
||||
- name: Create output dir
|
||||
run: |
|
||||
mkdir -p bin
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
|
||||
with:
|
||||
go-version: 1.18.1
|
||||
go-version: '1.22.6'
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
CGO_ENABLED=1 \
|
||||
GOOS=darwin \
|
||||
GOARCH=${{ matrix.arch }} \
|
||||
go build -mod=vendor -a -trimpath -o bin/${{ env.out }}
|
||||
go build -mod=vendor -a -trimpath -o bin/${{ env.out }} ./recovery_tool
|
||||
|
||||
- name: Upload binary
|
||||
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
||||
with:
|
||||
name: ${{ env.out }}
|
||||
path: bin/${{ env.out }}
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -53,9 +53,15 @@ jobs:
|
||||
- os: "linux"
|
||||
arch: "386"
|
||||
out: "recovery-tool-linux32"
|
||||
cc: "i686-linux-gnu-gcc-12"
|
||||
- os: "linux"
|
||||
arch: "amd64"
|
||||
out: "recovery-tool-linux64"
|
||||
cc: "x86_64-linux-gnu-gcc-12"
|
||||
- os: "linux"
|
||||
arch: "arm64"
|
||||
out: "recovery-tool-linuxaarch64"
|
||||
cc: "aarch64-linux-gnu-gcc-12"
|
||||
- os: "windows"
|
||||
arch: "386"
|
||||
cc: "i686-w64-mingw32-gcc"
|
||||
@@ -67,21 +73,21 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6
|
||||
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
|
||||
with:
|
||||
buildkitd-flags: --debug
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
|
||||
- name: Create output dir
|
||||
run: |
|
||||
mkdir -p bin
|
||||
|
||||
- name: Build
|
||||
uses: docker/build-push-action@c84f38281176d4c9cdb1626ffafcd6b3911b5d94
|
||||
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
|
||||
with:
|
||||
file: Dockerfile
|
||||
file: recovery_tool/Dockerfile
|
||||
context: .
|
||||
outputs: bin
|
||||
cache-from: type=gha
|
||||
@@ -93,21 +99,25 @@ jobs:
|
||||
out=${{ matrix.target.out }}
|
||||
|
||||
- name: Upload binary
|
||||
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
||||
with:
|
||||
name: ${{ matrix.target.out }}
|
||||
path: bin/${{ matrix.target.out }}
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
needs: [build-mac, build]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
path: artifacts
|
||||
pattern: recovery-tool-*
|
||||
|
||||
- name: Compute SHA256 checksums
|
||||
run: |
|
||||
@@ -117,7 +127,7 @@ jobs:
|
||||
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
|
||||
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
body_path: sha_sum_table
|
||||
|
||||
Reference in New Issue
Block a user