diff --git a/.github/workflows/build-m1-wheel.yml b/.github/workflows/build-m1-wheel.yml index 5831afae..a7a3c0a4 100644 --- a/.github/workflows/build-m1-wheel.yml +++ b/.github/workflows/build-m1-wheel.yml @@ -111,22 +111,32 @@ jobs: name: wheels path: ./target/wheels - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_AWS_SECRET - - if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi - echo HAS_AWS_SECRET=${HAS_AWS_SECRET} >>$GITHUB_OUTPUT - env: - AWS_SECRET: "${{ secrets.CHIA_AWS_ACCOUNT_ID }}" + upload: + name: Upload to PyPI + runs-on: ubuntu-latest + needs: build_wheels + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Set Env uses: Chia-Network/actions/setjobenv@main env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Install python + uses: Chia-Network/actions/setup-python@main + with: + python-version: "3.10" + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: wheels + path: ./target/wheels/ + - name: publish (PyPi) if: env.RELEASE == 'true' uses: pypa/gh-action-pypi-publish@release/v1 @@ -142,6 +152,17 @@ jobs: packages-dir: target/wheels/ skip-existing: true + - name: Test for secrets access + id: check_secrets + shell: bash + run: | + unset HAS_AWS_SECRET + + if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi + echo HAS_AWS_SECRET=${HAS_AWS_SECRET} >>$GITHUB_OUTPUT + env: + AWS_SECRET: "${{ secrets.CHIA_AWS_ACCOUNT_ID }}" + - name: Configure AWS credentials if: steps.check_secrets.outputs.HAS_AWS_SECRET uses: aws-actions/configure-aws-credentials@v2 @@ -151,8 +172,10 @@ jobs: - name: Publish Dev if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/dev' + shell: bash + working-directory: ./target/wheels run: | - FILES=$(find ${{ github.workspace }}/target/wheels -type f -name '*.whl') + FILES=$(find . -type f -name '*.whl') while IFS= read -r file; do filename=$(basename $file) aws --no-progress s3 cp "$file" "s3://download.chia.net/simple-dev/clvm-tools-rs/$filename" diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 40960948..b3f9b9f7 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -223,36 +223,52 @@ jobs: rustup component add llvm-tools-preview python ./resources/coverage/run_coverage.py --require-percent 60 + - name: Build alpine wheel via docker + if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.8') + run: | + cd resources/alpine && docker build -t clvm-tools-rs-alpine . + docker run -v ${GITHUB_WORKSPACE}:/root/clvm_tools_rs -t clvm-tools-rs-alpine sh /root/build-alpine.sh + - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: wheels path: ./target/wheels/ - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_AWS_SECRET - - if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi - echo HAS_AWS_SECRET=${HAS_AWS_SECRET} >>$GITHUB_OUTPUT - env: - AWS_SECRET: "${{ secrets.CHIA_AWS_ACCOUNT_ID }}" + upload: + name: Upload to PyPI + runs-on: ubuntu-latest + needs: build_wheels + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Set Env uses: Chia-Network/actions/setjobenv@main env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: publish (PyPi) + - name: Install python + uses: Chia-Network/actions/setup-python@main + with: + python-version: "3.10" + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: wheels + path: ./target/wheels/ + + - name: Publish distribution to PyPI if: env.RELEASE == 'true' uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: target/wheels/ skip-existing: true - - name: publish (Test PyPi) + - name: Publish distribution to Test PyPI if: env.PRE_RELEASE == 'true' uses: pypa/gh-action-pypi-publish@release/v1 with: @@ -260,6 +276,17 @@ jobs: packages-dir: target/wheels/ skip-existing: true + - name: Test for secrets access + id: check_secrets + shell: bash + run: | + unset HAS_AWS_SECRET + + if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi + echo HAS_AWS_SECRET=${HAS_AWS_SECRET} >>$GITHUB_OUTPUT + env: + AWS_SECRET: "${{ secrets.CHIA_AWS_ACCOUNT_ID }}" + - name: Configure AWS credentials if: steps.check_secrets.outputs.HAS_AWS_SECRET uses: aws-actions/configure-aws-credentials@v2 @@ -278,12 +305,6 @@ jobs: aws --no-progress s3 cp "$file" "s3://download.chia.net/simple-dev/clvm-tools-rs/$filename" done <<< "$FILES" - - name: Build alpine wheel via docker - if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.8') - run: | - cd resources/alpine && docker build -t clvm-tools-rs-alpine . - docker run -v ${GITHUB_WORKSPACE}:/root/clvm_tools_rs -t clvm-tools-rs-alpine sh /root/build-alpine.sh - fmt: runs-on: ubuntu-20.04 name: cargo fmt