feat: new release job and some release notes

This commit is contained in:
rvcas 2023-02-23 18:52:56 -05:00
parent 34afa9197c
commit 1bc3362788
No known key found for this signature in database
GPG Key ID: C09B64E263F7D68C
6 changed files with 214 additions and 60 deletions

View File

@ -2,7 +2,7 @@ name: Nix
on:
push:
branches: [ "main" ]
branches: ["main"]
jobs:
update-cargo-nix:
@ -12,29 +12,29 @@ jobs:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.WORKFLOW_SSH_KEY }}
- name: Checkout repository
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.WORKFLOW_SSH_KEY }}
- name: Install Nix
uses: cachix/install-nix-action@v18
- name: Install Nix
uses: cachix/install-nix-action@v18
- name: Setup Cachix
uses: cachix/cachix-action@v12
with:
name: aiken-lang
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Setup Cachix
uses: cachix/cachix-action@v12
with:
name: aiken-lang
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Run cargo2nix
shell: bash
run: |
nix run github:cargo2nix/cargo2nix -- -s > Cargo.nix
- name: Run cargo2nix
shell: bash
run: |
nix run github:cargo2nix/cargo2nix -- -s > Cargo.nix
- name: Create PR
uses: peter-evans/create-pull-request@v4
with:
branch: patch/cargo.nix
delete-branch: true
title: Update Cargo.nix
add-paths: Cargo.nix
- name: Create PR
uses: peter-evans/create-pull-request@v4
with:
branch: patch/cargo.nix
delete-branch: true
title: Update Cargo.nix
add-paths: Cargo.nix

137
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,137 @@
name: Release
on:
push:
tags:
- "v*.*.*"
env:
CARGO_TERM_COLOR: always
jobs:
prepare:
name: Prepare release
runs-on: ubuntu-20.04
outputs:
tag_name: ${{ steps.release_info.outputs.tag_name }}
release_name: ${{ steps.release_info.outputs.release_name }}
release_notes: ${{ steps.extract_release_notes.outputs.release_notes }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Compute release name and tag
id: release_info
run: |
echo "::set-output name=tag_name::${GITHUB_REF_NAME}"
echo "::set-output name=release_name::${GITHUB_REF_NAME}"
- name: Extract release notes
id: extract_release_notes
run: |
release_notes=$(sed -n '/^## .*$/,$p' CHANGELOG.md | sed '1d;/^## /,$d')
echo "::set-output name=release_notes::${release_notes}"
release:
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
runs-on: ${{ matrix.job.os }}
needs: prepare
strategy:
matrix:
job:
# os: used for the runner
# platform: a generic platform name
# target: used by Cargo
# arch: either 386, arm64 or amd64
- os: ubuntu-20.04
platform: linux
target: x86_64-unknown-linux-gnu
arch: amd64
- os: ubuntu-20.04
platform: linux
target: aarch64-unknown-linux-gnu
arch: arm64
- os: macos-latest
platform: darwin
target: x86_64-apple-darwin
arch: amd64
- os: macos-latest
platform: darwin
target: aarch64-apple-darwin
arch: arm64
- os: windows-latest
platform: win32
target: x86_64-pc-windows-msvc
arch: amd64
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.job.target }}
override: true
- uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true
- name: Apple M1 setup
if: ${{ matrix.job.target == 'aarch64-apple-darwin' }}
run: |
echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV
- name: Linux ARM setup
if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }}
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Build binaries
uses: actions-rs/cargo@v1
with:
command: build
args: --release --bins --target ${{ matrix.job.target }}
- name: Archive binaries
id: artifacts
env:
PLATFORM_NAME: ${{ matrix.job.platform }}
TARGET: ${{ matrix.job.target }}
ARCH: ${{ matrix.job.arch }}
VERSION_NAME: ${{ needs.prepare.outputs.tag_name }}
run: |
if [ "$PLATFORM_NAME" == "linux" ]; then
tar -czvf "aiken_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release forge cast anvil chisel
echo "::set-output name=file_name::aiken_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz"
elif [ "$PLATFORM_NAME" == "darwin" ]; then
# We need to use gtar here otherwise the archive is corrupt.
# See: https://github.com/actions/virtual-environments/issues/2619
gtar -czvf "aiken_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release aiken
echo "::set-output name=file_name::aiken_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz"
else
cd ./target/${TARGET}/release
7z a -tzip "aiken_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" aiken.exe
mv "aiken_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" ../../../
echo "::set-output name=file_name::aiken_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip"
fi
shell: bash
# Creates the release for this specific version
- name: Create release
uses: softprops/action-gh-release@v1
with:
name: ${{ needs.prepare.outputs.release_name }}
tag_name: ${{ needs.prepare.outputs.tag_name }}
body: ${{ needs.prepare.outputs.release_notes }}
files: |
${{ steps.artifacts.outputs.file_name }}

View File

@ -1,32 +0,0 @@
name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose --workspace
- name: Run unit tests
run: cargo test --verbose --workspace
- name: Run acceptance tests
working-directory: examples/acceptance_tests
run: |
cargo install cbor-diag-cli
bash ci
shell: bash
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Audit
run: cargo audit

32
.github/workflows/tests.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Tests
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose --workspace
- name: Run unit tests
run: cargo test --verbose --workspace
- name: Run acceptance tests
working-directory: examples/acceptance_tests
run: |
cargo install cbor-diag-cli
bash ci
shell: bash
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Audit
run: cargo audit

View File

@ -1,18 +1,35 @@
# Changelog
## [next] - 2023-MM-DD
## [v0.0.29] - 2023-MM-DD
### Added
- **aiken-project**: new dep rayon for parallel test execution
- **aiken**: new blueprint command
- **aiken-lang**: new syntax for defining validators
- **aiken**: new address command for deriving addresses out of `plutus.json`
- **aiken-lang**: Add missing Plutus builtins to Aiken's lang.
- **aiken**: fancy nix stuff
- **aiken-lsp**: go to definition
- **aiken-lsp**: docs on hover
- **aiken-lsp**: enable compiler a project
### Changed
N/A
- **aiken-lang**: `assert` renamed to `expect`
- **aiken-lang**: new syntax for strings and byte array literals
- **aiken-lang**: lots of code gen improvements
- **aiken-lang**: validator checks now happen during infer instead of in project
- **aiken-lang**: fixed unicode parsing
- **aiken-lang**: update default costs models
- **aiken-lang**: Use variable-length threshold for levenshtein distance
- **aiken-project**: Move module name validation outside of type-checking
- **aiken-project**: Add 'plutusVersion' to blueprints
### Removed
N/A
- **aiken-project**: remove assets folder in favor of `plutus.json`
- **aiken-lang**: removed some unused constant related data types
## [v0.0.28] - 2023-01-06
@ -109,7 +126,7 @@ N/A
- **aiken**: Inject `aiken/builtin` module with some functions from `DefaultFunction` in UPLC directly exposed
- **aiken-lang**: add `infer` method to `UntypedModule` which returns a `TypedModule`
- **uplc**: Expose various Pallas primitives from UPLC to make constructing
UPLC types possible for consumers
UPLC types possible for consumers
### Changed

View File

@ -6,7 +6,7 @@
[![Licence](https://img.shields.io/github/license/aiken-lang/aiken)](https://github.com/aiken-lang/aiken/blob/main/LICENSE)
[![Crates.io](https://img.shields.io/crates/v/aiken)](https://crates.io/crates/aiken)
[![Rust Build](https://github.com/aiken-lang/aiken/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/aiken-lang/aiken/actions/workflows/rust.yml)
[![Tests](https://github.com/aiken-lang/aiken/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/aiken-lang/aiken/actions/workflows/tests.yml)
<hr/>
</div>