Skip to content

Commit

Permalink
Upgrading workflow: Publish artifacts to GitHub Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
MedovTimur committed Dec 3, 2024
1 parent cea1d1c commit 82cc46f
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,34 @@ jobs:
- name: Run tests
run: cargo test -r --all -- --ignored

- name: Build for WASM
run: cargo build --release --target wasm32-unknown-unknown

- name: Collect artifacts
run: |
mkdir -p artifacts
cp target/wasm32-unknown-unknown/release/*.wasm artifacts/
cp target/wasm32-unknown-unknown/release/*.idl artifacts/
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: artifacts/*

- name: Publish artifacts to GitHub Packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Publishing artifacts to GitHub Packages"
mkdir -p packages
for file in artifacts/*; do
filename=$(basename "$file")
curl -u "${{ secrets.GITHUB_ACTOR }}:${{ secrets.GITHUB_TOKEN }}" \
-X POST \
-H "Content-Type: application/octet-stream" \
--data-binary @"$file" \
https://api.github.com/repos/${{ github.repository }}/packages \
-H "Accept: application/vnd.github.v3+json"
done

0 comments on commit 82cc46f

Please sign in to comment.