diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 3d1be7d..6a80804 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -9,21 +9,38 @@ on: jobs: release-artifacts: runs-on: ubuntu-latest + container: cosmwasm/workspace-optimizer:0.15.1 steps: - uses: actions/checkout@v3 - - name: Install latest stable - uses: ATiltedTree/setup-rust@v1 + + # tar is required for cargo cache + - run: apk add --no-cache tar + + - name: Set up cargo cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Compile contracts + timeout-minutes: 30 + run: optimize_workspace.sh . + + - name: Upload contracts + uses: actions/upload-artifact@v3 + with: + name: contracts + path: artifacts/ + + - name: release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') with: - rust-version: stable - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Build Artifacts - run: | - ./devtools/optimize.sh - - name: Commit artifacts - run: | - git config --global user.name 'DA0-DA0' - git config --global user.email 'DA0-DA0@users.noreply.github.com' - git add artifacts --force - git commit -m "Update artifacts [skip ci]" - git push + files: artifacts/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}