Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,23 @@ jobs:
shell: bash
run: tar -C target/${{ matrix.target }}/release -czf ${{ matrix.asset_name }}.tar.gz ${{ matrix.artifact_name }}

- name: Generate SHA-256 checksum
shell: bash
env:
ASSET_NAME: ${{ matrix.asset_name }}
run: |
if command -v sha256sum >/dev/null 2>&1; then
sha256sum "${ASSET_NAME}.tar.gz" > "${ASSET_NAME}.tar.gz.sha256"
else
shasum -a 256 "${ASSET_NAME}.tar.gz" > "${ASSET_NAME}.tar.gz.sha256"
fi
cat "${ASSET_NAME}.tar.gz.sha256"

- name: Upload to Release
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3
with:
tag_name: v${{ needs.release.outputs.new_release_version }}
files: ${{ matrix.asset_name }}.tar.gz
files: |
${{ matrix.asset_name }}.tar.gz
${{ matrix.asset_name }}.tar.gz.sha256
token: ${{ steps.generate_token.outputs.token }}
130 changes: 96 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ log = "0.4.29"
reqwest = { version = "0.13.3", features = ["stream", "rustls", "json"] }
semver = "1.0.28"
serde = { version = "1.0.228", features = ["derive"] }
sha2 = "0.10.9"
serde_json = "1.0.149"
tar = "0.4.45"
tempfile = "3.27.0"
Expand Down
5 changes: 5 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ pub enum Commands {
/// Initialize a .php-version file in the current directory
#[clap(name = "init")]
Init(commands::init::Init),

/// Check for and apply updates to pvm itself
#[clap(name = "self-update")]
SelfUpdate(commands::self_update::SelfUpdate),
}

impl Commands {
Expand All @@ -65,6 +69,7 @@ impl Commands {
Self::Current(cmd) => cmd.call().await,
Self::Uninstall(cmd) => cmd.call().await,
Self::Init(cmd) => cmd.call().await,
Self::SelfUpdate(cmd) => cmd.call().await,
}
}
}
1 change: 1 addition & 0 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ pub mod init;
pub mod install;
pub mod ls;
pub mod ls_remote;
pub mod self_update;
pub mod uninstall;
pub mod use_cmd;
Loading