Skip to content

Update actions/checkout action to v4 #26

Update actions/checkout action to v4

Update actions/checkout action to v4 #26

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
pull_request:
paths:
- '.github/workflows/release.yml'
permissions:
contents: write
env:
CARGO_INCREMENTAL: 0
jobs:
release:
runs-on: ubuntu-latest
needs: gen_doc
steps:
- uses: actions/checkout@v4
- name: Release
uses: softprops/action-gh-release@v0.1.15
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
prerelease: true
generate_release_notes: true
publish:
runs-on: ubuntu-latest
needs: gen_doc
steps:
- uses: actions/checkout@v4
- name: Get Rust toolchain
id: toolchain
run: |
echo -n "::set-output name=toolchain::"
awk -F'[ ="]+' '$1 == "channel" { print $2 }' rust-toolchain
- uses: actions-rs/toolchain@v1.0.7
with:
toolchain: ${{ steps.toolchain.outputs.toolchain }}
- name: prepare for package(download jsonschema for docs.rs build)
run: |
cargo clean
cargo build --features build-with-local-schema
- name: check downloaded jsonschema
run: |
ls json_schema/*.jsonschema
- name: package
run: |
cargo package --features build-with-local-schema --allow-dirty
- name: check package
run: |
echo "$ ls"; ls
echo "$ ls target/package"; ls target/package/
echo "$ ls target/package/rdfmt-*/json_schema"; ls target/package/rdfmt-*/json_schema
- name: publish(dry run)
run: |
cargo publish --features default,build-with-local-schema --allow-dirty --dry-run
- name: publish
if: startsWith(github.ref, 'refs/tags/')
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo publish --features default,build-with-local-schema --allow-dirty
gen_doc:
name: generate document test for docs.rs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: remove rust-toolchain for set docs.rs Rust version
run: rm rust-toolchain
- uses: actions-rs/toolchain@v1.0.7
with:
toolchain: nightly-2021-12-30
override: true
- name: check cargo version
run: cargo --version
- name: gen doc
run: cargo doc