name: 'build-gosop' description: 'Build gosop from the current branch' inputs: go-crypto-ref: description: 'go-crypto branch tag or commit to build from' required: true default: '' binary-location: description: 'Path for the gosop binary' required: true default: './gosop-${{ github.sha }}' branch-gosop: description: 'Branch of the gosop to use' required: false default: 'main' gosop-build-path: description: 'Build script of the gosop to use' required: false default: 'build_gosop_v1.sh' runs: using: "composite" steps: - name: Checkout go-crypto uses: actions/checkout@v3 with: ref: ${{ inputs.go-crypto-ref }} path: go-crypto # Build gosop - name: Set up latest golang uses: actions/setup-go@v3 with: go-version: ^1.18 - name: Check out gosop uses: actions/checkout@v3 with: repository: ProtonMail/gosop ref: ${{ inputs.branch-gosop }} path: gosop - name: Cache go modules uses: actions/cache@v3 with: path: | ~/.cache/go-build ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - name: Build gosop run: ./.github/test-suite/${{ inputs.gosop-build-path }} shell: bash # Test the binary - name: Print gosop version run: ./gosop/gosop version --extended shell: bash # Move and rename binary - name: Move binary run: mv gosop/gosop ${{ inputs.binary-location }} shell: bash