commit 64b63244a9b4353e5b6cd0ca44144276fc442e8b
parent a53139813efdaa179bd5842483e795dbff66b8d9
Author: Eric Scouten <scouten@adobe.com>
Date: Wed, 30 Aug 2023 16:44:57 -0700
(IGNORE) Update GitHub Actions workflows to remove outdated steps (#296)
Diffstat:
2 files changed, 41 insertions(+), 65 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
@@ -29,7 +29,7 @@ jobs:
components: llvm-tools-preview
- name: Cache Rust dependencies
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
@@ -68,7 +68,7 @@ jobs:
run: cargo install cross
- name: Cache Rust dependencies
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
# Note that we do not run code coverage because
# it isn't readily accessible from cross-compilation
@@ -86,9 +86,7 @@ jobs:
uses: actions/checkout@v3
- name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@master
- with:
- toolchain: stable
+ uses: dtolnay/rust-toolchain@stable
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
@@ -111,13 +109,12 @@ jobs:
uses: actions/checkout@v3
- name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@master
+ uses: dtolnay/rust-toolchain@nightly
with:
- toolchain: nightly
components: llvm-tools-preview
- name: Cache Rust dependencies
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo +nightly test -Z direct-minimal-versions --all-targets --all-features
@@ -143,7 +140,7 @@ jobs:
components: llvm-tools-preview
- name: Cache Rust dependencies
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
- name: Dry-run of crate publish
run: cargo publish -p c2pa --dry-run
@@ -156,15 +153,13 @@ jobs:
uses: actions/checkout@v3
- name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@master
- with:
- toolchain: stable
+ uses: dtolnay/rust-toolchain@stable
- name: Install clippy
run: rustup component add clippy
- name: Cache Rust dependencies
- uses: Swatinem/rust-cache@v1
+ uses: Swatinem/rust-cache@v2
- name: Cargo clippy
uses: actions-rs/clippy-check@v1
@@ -182,16 +177,12 @@ jobs:
uses: actions/checkout@v3
- name: Install stable toolchain
- uses: dtolnay/rust-toolchain@master
+ uses: dtolnay/rust-toolchain@nightly
with:
- toolchain: nightly
components: rustfmt
- name: Check format
- uses: actions-rs/cargo@v1
- with:
- command: fmt
- args: --all -- --check
+ run: cargo +nightly fmt --all -- --check
docs_rs:
name: Preflight docs.rs build
@@ -204,9 +195,7 @@ jobs:
# Nightly is used here because the docs.rs build
# uses nightly and we use doc_cfg features that are
# not in stable Rust as of this writing (Rust 1.62).
- uses: dtolnay/rust-toolchain@master
- with:
- toolchain: nightly
+ uses: dtolnay/rust-toolchain@nightly
- name: Run cargo docs
# This is intended to mimic the docs.rs build
@@ -249,9 +238,7 @@ jobs:
uses: actions/checkout@v3
- name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@master
- with:
- toolchain: nightly
+ uses: dtolnay/rust-toolchain@nightly
- name: Run cargo-udeps
uses: aig787/cargo-udeps-action@v1
@@ -267,9 +254,7 @@ jobs:
uses: actions/checkout@v3
- name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@master
- with:
- toolchain: nightly
+ uses: dtolnay/rust-toolchain@nightly
- name: Check for unknown features
env:
@@ -283,20 +268,18 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
-
- - name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@master
with:
- toolchain: stable
+ fetch-depth: 0
+
+ - name: Install Rust toolchain
+ uses: dtolnay/rust-toolchain@stable
- name: Get latest existing tag
- uses: actions-ecosystem/action-get-latest-tag@v1
+ uses: WyriHaximus/github-action-get-previous-tag@v1
id: get-latest-tag
- with:
- semver_only: true
- name: Set new version
- uses: paulhatch/semantic-version@v5.0.2
+ uses: paulhatch/semantic-version@v5.2.1
id: set-version
with:
tag_prefix: "v"
@@ -305,12 +288,12 @@ jobs:
minor_pattern: "(MINOR)"
- name: Generate changelog since last tag
- uses: mathiasvr/command-output@v1
- ## NEEDS UPDATE for set-output deprecation.
- ## See https://github.com/mathiasvr/command-output/issues/4.
- id: changelog
- with:
- run: git log --format="* %s" ${{ steps.get-latest-tag.outputs.tag }}..HEAD
+ run: |
+ {
+ echo 'changelog<<EOF'
+ git log --format="* %s" ${{ steps.get-latest-tag.outputs.tag }}..HEAD | { grep -v "(IGNORE)" || :; }
+ echo EOF
+ } >> "$GITHUB_OUTPUT"
- name: "Bump crate version (NOTE: Not pushed back to repo!)"
continue-on-error: true # If no change to crate version, ignore git commit error
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
@@ -10,21 +10,17 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@v2
+ 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.
+ uses: WyriHaximus/github-action-get-previous-tag@v1
id: get-latest-tag
- with:
- semver_only: true
- name: Set new version
- uses: paulhatch/semantic-version@v5.0.2
+ uses: paulhatch/semantic-version@v5.2.1
id: set-version
with:
tag_prefix: "v"
@@ -33,13 +29,14 @@ jobs:
minor_pattern: "(MINOR)"
- name: Generate changelog since last tag
- uses: mathiasvr/command-output@v1
- ## NEEDS UPDATE for set-output deprecation.
- ## See https://github.com/mathiasvr/command-output/issues/4.
- id: changelog
- with:
- run: git log --format="* %s" ${{ steps.get-latest-tag.outputs.tag }}..HEAD | { grep -v "(IGNORE)" || :; }
-
+ id: generate-changelog
+ run: |
+ {
+ echo 'changelog<<EOF'
+ git log --format="* %s" ${{ steps.get-latest-tag.outputs.tag }}..HEAD | { grep -v "(IGNORE)" || :; }
+ echo EOF
+ } >> "$GITHUB_OUTPUT"
+
- name: Log version & changelog
run: |
echo "Version: $VERSION"
@@ -50,10 +47,10 @@ jobs:
VERSION: ${{ steps.set-version.outputs.version }}
VERSION_TAG: ${{ steps.set-version.outputs.version_tag }}
LATEST_TAG: ${{ steps.get-latest-tag.outputs.tag }}
- CHANGELOG: ${{ steps.changelog.outputs.stdout }}
+ CHANGELOG: ${{ steps.generate-changelog.outputs.stdout }}
- name: Prevent empty release
- if: ${{ steps.changelog.outputs.stdout == '' }}
+ if: ${{ steps.generate-changelog.outputs.stdout == '' }}
uses: actions/github-script@v3
with:
script: |
@@ -65,12 +62,10 @@ jobs:
mv CHANGELOG.new.md CHANGELOG.md
env:
VERSION: ${{ steps.set-version.outputs.version }}
- CHANGELOG: ${{ steps.changelog.outputs.stdout }}
+ CHANGELOG: ${{ steps.generate-changelog.outputs.stdout }}
- name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@master
- with:
- toolchain: stable
+ uses: dtolnay/rust-toolchain@stable
- name: Bump crate versions
run: |
@@ -86,8 +81,6 @@ jobs:
- name: Commit Cargo.toml and changelog
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:
commit_message: Prepare ${{ steps.set-version.outputs.version }} release
@@ -102,7 +95,7 @@ jobs:
- name: Create release
uses: ncipollo/release-action@v1
with:
- body: ${{ steps.changelog.outputs.stdout }}
+ body: ${{ steps.generate-changelog.outputs.stdout }}
commit: ${{ steps.commit.outputs.commit_hash }}
prerelease: true # remove at 1.0
tag: ${{ steps.set-version.outputs.version_tag }}