-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install latest verison of rust and build binaries.
- Loading branch information
Showing
2 changed files
with
115 additions
and
55 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,83 +18,127 @@ on: | |
|
||
workflow_dispatch: | ||
|
||
env: | ||
name: row | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
name: row | ||
CARGO_TERM_COLOR: always | ||
CLICOLOR: 1 | ||
RUST_VERSION: 1.78.0 | ||
|
||
jobs: | ||
source: | ||
name: Build source tarball | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
submodules: true | ||
path: code | ||
- uses: actions/[email protected] | ||
with: | ||
path: code | ||
|
||
- name: Determine filename-safe ref from GITHUB_REF_NAME | ||
run: echo ref="$(echo "${GITHUB_REF_NAME}" | sed -e 's/\//-/g')" >> "$GITHUB_ENV" | ||
- name: Determine filename-safe ref from GITHUB_REF_NAME | ||
run: echo ref="$(echo "${GITHUB_REF_NAME}" | sed -e 's/\//-/g')" >> "$GITHUB_ENV" | ||
|
||
- name: Copy source | ||
run: cp -R code "${name}-${ref}" | ||
- name: Copy source | ||
run: cp -R code "${name}-${ref}" | ||
|
||
- name: Remove .git | ||
run: rm -rf "${name}-${ref}/.git" && ls -laR "${name}-${ref}" | ||
- name: Remove .git | ||
run: rm -rf "${name}-${ref}/.git" && ls -laR "${name}-${ref}" | ||
|
||
- name: Tar/xz source | ||
run: tar -cvJf "${name}-${ref}.tar.xz" "${name}-${ref}" | ||
- name: Tar/xz source | ||
run: tar -cvJf "${name}-${ref}.tar.xz" "${name}-${ref}" | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
name: source | ||
path: | | ||
*.tar.* | ||
- uses: actions/[email protected] | ||
with: | ||
name: source | ||
path: | | ||
*.tar.* | ||
release-notes: | ||
name: Extract release notes | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
submodules: true | ||
path: code | ||
- uses: actions/[email protected] | ||
with: | ||
path: code | ||
|
||
- name: Write release-notes.md | ||
run: grep -P -m 2 -B 10000 "^## v*\d*\.\d*\.\d*" doc/src/release-notes.md | sed '$d' | tee "${GITHUB_WORKSPACE}/release-notes.md" | ||
working-directory: code | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
name: release-notes | ||
path: | | ||
release-notes.md | ||
binary: | ||
name: Build [${{ matrix.target }}] | ||
runs-on: ${{ matrix.runner }} | ||
strategy: | ||
matrix: | ||
target: | ||
- x86_64-unknown-linux-gnu | ||
- aarch64-apple-darwin | ||
include: | ||
- target: x86_64-unknown-linux-gnu | ||
runner: ubuntu-20.04 | ||
- target: aarch64-apple-darwin | ||
runner: macos-14 | ||
|
||
- name: Write release-notes.md | ||
run: grep -P -m 2 -B 10000 "^## v*\d*\.\d*\.\d*" doc/src/release-notes.md | sed '$d' | tee "${GITHUB_WORKSPACE}/release-notes.md" | ||
working-directory: code | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
name: release-notes | ||
path: | | ||
release-notes.md | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Determine filename-safe ref from GITHUB_REF_NAME | ||
run: echo ref="$(echo "${GITHUB_REF_NAME}" | sed -e 's/\//-/g')" >> "$GITHUB_ENV" | ||
- name: Update rust | ||
run: rustup install "$RUST_VERSION" --no-self-update && rustup default "$RUST_VERSION" | ||
- name: Check rust installation | ||
run: rustc -vV | ||
- uses: actions/[email protected] | ||
with: | ||
path: | | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-rust-${{ env.RUST_VERSION }}-cargo-release-binary-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Build | ||
run: cargo build --locked --bin "${name}" --release --target ${{ matrix.target }} | ||
- name: Check output | ||
run: file "target/${{ matrix.target }}/release/${name}" | ||
- name: Compress | ||
run: xz "target/${{ matrix.target }}/release/${name}" | ||
- name: Rename | ||
run: mv "target/${{ matrix.target }}/release/${name}.xz" "${name}-${ref}-${{ matrix.target }}.xz" | ||
- uses: actions/[email protected] | ||
with: | ||
name: ${{ matrix.target }} | ||
path: "${name}-${ref}-${{ matrix.target }}.xz" | ||
|
||
publish: | ||
name: Publish [GitHub] | ||
needs: [source, release-notes] | ||
needs: [binary, source, release-notes] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Download artifacts | ||
uses: actions/[email protected] | ||
with: | ||
merge-multiple: true | ||
|
||
- name: List files | ||
run: ls -lR | ||
|
||
- name: Create release | ||
uses: softprops/[email protected] | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
with: | ||
files: | | ||
*.xz | ||
body_path: release-notes.md | ||
make_latest: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Download artifacts | ||
uses: actions/[email protected] | ||
with: | ||
merge-multiple: true | ||
|
||
- name: List files | ||
run: ls -lR | ||
|
||
- name: Create release | ||
uses: softprops/[email protected] | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
with: | ||
files: | | ||
*.xz | ||
body_path: release-notes.md | ||
make_latest: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ env: | |
CLICOLOR: 1 | ||
MDBOOK_VERSION: 0.4.37 | ||
LINKCHECK_VERSION: 0.7.7 | ||
RUST_VERSION: 1.78.0 | ||
|
||
jobs: | ||
unit_test: | ||
|
@@ -40,14 +41,18 @@ jobs: | |
|
||
steps: | ||
- uses: actions/[email protected] | ||
- name: Update rust | ||
run: rustup install "$RUST_VERSION" --no-self-update && rustup default "${RUST_VERSION}" | ||
- name: Check rust installation | ||
run: rustc -vV | ||
- uses: actions/[email protected] | ||
with: | ||
path: | | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-unit-test-${{ matrix.mode }}-${{ hashFiles('**/Cargo.lock') }} | ||
key: ${{ runner.os }}-rust-${{ env.RUST_VERSION }}-cargo-unit-test-${{ matrix.mode }}-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Build | ||
run: cargo build ${{ matrix.mode_option }} --verbose | ||
- name: Run tests | ||
|
@@ -58,14 +63,18 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Update rust | ||
run: rustup install "$RUST_VERSION" --no-self-update && rustup default "${RUST_VERSION}" | ||
- name: Check rust installation | ||
run: rustc -vV | ||
- uses: actions/[email protected] | ||
with: | ||
path: | | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-execute-tutorials-${{ hashFiles('**/Cargo.lock') }} | ||
key: ${{ runner.os }}-rust-${{ env.RUST_VERSION }}-cargo-execute-tutorials-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Install | ||
run: cargo install --path . --locked --verbose | ||
- name: Run hello.sh | ||
|
@@ -95,6 +104,10 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Update rust | ||
run: rustup install "$RUST_VERSION" --no-self-update && rustup default "${RUST_VERSION}" | ||
- name: Check rust installation | ||
run: rustc -vV | ||
- name: Install mdbook | ||
run: | | ||
mkdir -p "$HOME/.cargo/bin" | ||
|
@@ -116,8 +129,11 @@ jobs: | |
|
||
tests_complete: | ||
name: All tests | ||
if: always() | ||
needs: [unit_test, execute_tutorials, build_documentation] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- run: echo "Done!" | ||
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' | ||
- name: Done | ||
run: exit 0 |