Skip to content

Commit ac2b298

Browse files
committed
Update GitHub Actions and enhance asset creation with author details
1 parent 9503f2c commit ac2b298

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v6
2121
- uses: actions-rust-lang/setup-rust-toolchain@v1
22-
- uses: pnpm/action-setup@v4
22+
- uses: pnpm/action-setup@v5
2323
if: matrix.project == 'cli'
2424
with:
2525
package_json_file: ${{ matrix.project }}/package.json
@@ -98,19 +98,19 @@ jobs:
9898
- name: Log Docker tag
9999
run: echo "Docker tag is ${{ env.tag }}"
100100
- name: Login to Docker Hub
101-
uses: docker/login-action@v3
101+
uses: docker/login-action@v4
102102
if: ${{ env.tag != 'unknown' }}
103103
with:
104104
username: ${{ secrets.DOCKERHUB_USERNAME }}
105105
password: ${{ secrets.DOCKERHUB_TOKEN }}
106106
- name: Set up QEMU
107-
uses: docker/setup-qemu-action@v3
107+
uses: docker/setup-qemu-action@v4
108108
if: ${{ env.tag != 'unknown' }}
109109
- name: Set up Docker Buildx
110-
uses: docker/setup-buildx-action@v3
110+
uses: docker/setup-buildx-action@v4
111111
if: ${{ env.tag != 'unknown' }}
112112
- name: Build and push Docker image
113-
uses: docker/build-push-action@v6
113+
uses: docker/build-push-action@v7
114114
if: ${{ env.tag != 'unknown' }}
115115
with:
116116
context: .

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v6
1818
- name: Install pnpm
19-
uses: pnpm/action-setup@v4
19+
uses: pnpm/action-setup@v5
2020
with:
2121
package_json_file: docs/package.json
2222
- name: Use Node.js

cli/src/create.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ pub fn create_author(args: &CreateAuthorArgs) -> anyhow::Result<()> {
7878

7979
pub fn create_asset(args: &CreateAssetArgs) -> anyhow::Result<()> {
8080
let asset = Asset {
81+
author: args.author.clone(),
8182
name: args.name.clone(),
83+
id: format!("{}/{}", args.author, args.name),
8284
description: args.description.clone(),
8385
..Default::default()
8486
};
8587
let toml = toml::to_string(&asset)?;
86-
let author_path = std::path::Path::new(&args.path).join("content").join(&args.name);
88+
let author_path = std::path::Path::new(&args.path).join("content").join(&args.author);
8789
if !author_path.exists() {
8890
return Err(anyhow::anyhow!(
8991
"Author directory does not exist at {}",

cli/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ struct CreateAuthorArgs {
102102

103103
#[derive(Args)]
104104
struct CreateAssetArgs {
105+
/// The name of the author.
106+
#[arg()]
107+
author: String,
105108
/// The name of the asset.
106109
#[arg()]
107110
name: String,

0 commit comments

Comments
 (0)