Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ci #2

Merged
merged 7 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: release

on:
push:
tags:
- 'v*.*.*'

jobs:
artifact:
permissions:
contents: write
pull-requests: write
name: artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: software-mansion/setup-scarb@v1
- name: Build contracts
run: scarb build
- name: Archive contracts
run: |
mkdir -p filtered_artifacts
find ./target/dev -type f -name '*.contract_class.json' -exec cp {} filtered_artifacts/ \;
- name: Generate checksums
run: |
cd filtered_artifacts
for file in *; do
sha256sum "$file" > "$file.sha256"
md5sum "$file" > "$file.md5"
done
- name: Build artifact zip
run: |
cd filtered_artifacts
zip -r ../artifacts.zip .
cd ..
sha256sum artifacts.zip > artifacts.zip.sha256
md5sum artifacts.zip > artifacts.zip.md5

- name: Find zip files
run: |
find ./filtered_artifacts -type f -name '*.zip' -exec echo "::set-output name=zip_files::{}" \;
id: find_zip_files

- name: Release Artifact
uses: softprops/action-gh-release@v1
with:
files: |
artifacts.zip
artifacts.zip.sha256
artifacts.zip.md5


14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Tests
on:
push:
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
- uses: foundry-rs/setup-snfoundry@v3
- run: scarb fmt --check
- run: scarb build
- run: snforge test
Loading