Bug fixes #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly build | |
on: | |
workflow_dispatch: # TEMPORARY: Remove before merging PR | |
push: # TEMPORARY: Remove before merging PR | |
branches: main | |
# schedule: # TEMPORARY: Enable this before merging PR | |
# - cron: "0 5 * * *" # 0500 UTC every day | |
jobs: | |
# Create snapshot of main branch for nightly build | |
nightly-snapshot: | |
name: Create snapshot | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_ADMIN_COMMIT_TOKEN }} | |
- name: Get latest existing tag | |
uses: actions-ecosystem/action-get-latest-tag@v1 | |
## NEEDS UPDATE for set-output deprecation. | |
## See https://github.com/actions-ecosystem/action-get-latest-tag/issues/25. | |
id: get-latest-tag | |
with: | |
semver_only: true | |
- name: Set new proposed version | |
uses: paulhatch/semantic-version@v5.2.1 | |
id: set-version | |
with: | |
tag_prefix: "v" | |
version_format: "${major}.${minor}.${patch}" | |
major_pattern: "(MAJOR)" | |
minor_pattern: "(MINOR)" | |
- name: Add -nightly+(date)-(commit ID) prefix to version | |
id: set-nightly-version | |
run: | | |
echo version=${{ steps.set-version.outputs.version }}-nightly+`date +%F`-`git rev-parse --short HEAD` >> "$GITHUB_OUTPUT" | |
- name: Log new version & changelog | |
run: | | |
echo "Latest tag detected: $LATEST_TAG" | |
echo "Proposed new version: $VERSION" | |
echo "Nightly version: $NIGHTLY_VERSION" | |
env: | |
VERSION: ${{ steps.set-version.outputs.version }} | |
NIGHTLY_VERSION: ${{ steps.set-nightly-version.outputs.version }} | |
LATEST_TAG: ${{ steps.get-latest-tag.outputs.tag }} | |
- name: Bump crate versions | |
run: | | |
sed -i "s/^version = \"[^\"]*\"$/version = \"$VERSION\"/;" sdk/Cargo.toml | |
env: | |
VERSION: ${{ steps.set-nightly-version.outputs.version }} | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Update Cargo.lock | |
run: | | |
cargo update | |
- name: Report differences for "prepare (release)" commit | |
run: git diff | |
- name: Commit Cargo.toml and Cargo.lock | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
## NEEDS UPDATE for set-output deprecation. | |
## See https://github.com/stefanzweifel/git-auto-commit-action/issues/250. | |
id: commit | |
with: | |
branch: nightly | |
push_options: '--force' | |
commit_message: Prepare ${{ steps.set-nightly-version.outputs.version }} release | |
commit_user_name: Adobe CAI Team | |
commit_user_email: noreply@adobe.com | |
create_branch: true | |
# # make this into build step | |
# tests: | |
# name: Unit tests | |
# runs-on: ${{ matrix.os }} | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# os: [windows-latest, macos-latest, ubuntu-latest] | |
# rust_version: [stable, 1.70.0] | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v3 | |
# - name: Install Rust toolchain | |
# uses: dtolnay/rust-toolchain@master | |
# with: | |
# toolchain: ${{ matrix.rust_version }} | |
# components: llvm-tools-preview | |
# - name: Cache Rust dependencies | |
# uses: Swatinem/rust-cache@v1 | |
# - name: Install cargo-llvm-cov | |
# uses: taiki-e/install-action@cargo-llvm-cov | |
# - name: Generate code coverage | |
# run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info | |
# - name: Upload code coverage results | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# token: ${{ secrets.CODECOV_TOKEN }} | |
# fail_ci_if_error: true | |
# verbose: true |