mirror of
https://github.com/sergi0g/cup.git
synced 2025-11-09 13:43:49 -05:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90239f83e9 | ||
|
|
dc7a981930 | ||
|
|
8d2740dc7d | ||
|
|
fb674acf96 | ||
|
|
e9160334d9 | ||
|
|
ca6ffea29c | ||
|
|
923e81d75d |
34
.github/workflows/build.yml
vendored
34
.github/workflows/build.yml
vendored
@@ -18,21 +18,10 @@ jobs:
|
|||||||
build-binary:
|
build-binary:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
platform:
|
arch:
|
||||||
- release_for: linux-aarch64
|
- aarch64
|
||||||
os: ubuntu-latest
|
- x86_64
|
||||||
target: aarch64-unknown-linux-musl
|
runs-on: ubuntu-latest
|
||||||
bin: cup
|
|
||||||
name: cup-linux-aarch64
|
|
||||||
command: build
|
|
||||||
|
|
||||||
- release_for: linux-x86_64
|
|
||||||
os: ubuntu-latest
|
|
||||||
target: x86_64-unknown-linux-musl
|
|
||||||
bin: cup
|
|
||||||
name: cup-linux-x86_64
|
|
||||||
command: build
|
|
||||||
runs-on: ${{ matrix.platform.os }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -44,13 +33,13 @@ jobs:
|
|||||||
run: cargo install cross --git https://github.com/cross-rs/cross
|
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||||
|
|
||||||
- name: Build binary
|
- name: Build binary
|
||||||
run: cross ${{ matrix.platform.command }} --target ${{ matrix.platform.target }} --release
|
run: cross build --target ${{ matrix.arch }}-unknown-linux-musl --release
|
||||||
|
|
||||||
- name: Upload binary
|
- name: Upload binary
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.platform.name }}
|
name: cup-linux-${{ matrix.arch }}
|
||||||
path: target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}
|
path: target/${{ matrix.arch }}-unknown-linux-musl/release/cup
|
||||||
|
|
||||||
build-image:
|
build-image:
|
||||||
needs: get-tag
|
needs: get-tag
|
||||||
@@ -98,6 +87,11 @@ jobs:
|
|||||||
name: cup-linux-x86_64
|
name: cup-linux-x86_64
|
||||||
path: cup-linux-x86_64
|
path: cup-linux-x86_64
|
||||||
|
|
||||||
|
- name: Extract and rename binaries
|
||||||
|
run: |
|
||||||
|
unzip cup-linux-aarch64.zip && mv cup cup-linux-aarch64
|
||||||
|
unzip cup-linux-x86_64.zip && mv cup cup-linux-x86_64
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
env:
|
env:
|
||||||
@@ -107,5 +101,5 @@ jobs:
|
|||||||
tag_name: ${{ needs.get-tag.outputs.tag }}
|
tag_name: ${{ needs.get-tag.outputs.tag }}
|
||||||
name: ${{ needs.get-tag.outputs.tag }}
|
name: ${{ needs.get-tag.outputs.tag }}
|
||||||
files: |
|
files: |
|
||||||
cup-linux-aarch64/cup-linux-aarch64
|
cup-linux-aarch64
|
||||||
cup-linux-x86_64/cup-linux-x86_64
|
cup-linux-x86_64
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -2,3 +2,6 @@
|
|||||||
/docs/.next
|
/docs/.next
|
||||||
/docs/node_modules
|
/docs/node_modules
|
||||||
/docs/out
|
/docs/out
|
||||||
|
|
||||||
|
# In case I accidentally commit mine...
|
||||||
|
cup.json
|
||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -350,7 +350,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cup"
|
name = "cup"
|
||||||
version = "1.1.3"
|
version = "2.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bollard",
|
"bollard",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cup"
|
name = "cup"
|
||||||
version = "1.1.3"
|
version = "2.0.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Cup is the easiest way to check for container image updates.
|
|||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Take a look at https://sergi0g.github.io/cup/docs/introduction!
|
Take a look at https://sergi0g.github.io/cup/docs!
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,15 @@
|
|||||||
"index": {
|
"index": {
|
||||||
"title": "Introduction"
|
"title": "Introduction"
|
||||||
},
|
},
|
||||||
|
"installation": {
|
||||||
|
"title": "Installation"
|
||||||
|
},
|
||||||
|
"configuration": {
|
||||||
|
"title": "Configuration"
|
||||||
|
},
|
||||||
|
"usage": {
|
||||||
|
"title": "Usage"
|
||||||
|
},
|
||||||
"nightly": {
|
"nightly": {
|
||||||
"title": "Using the latest version"
|
"title": "Using the latest version"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ pub fn get_latest_digest(image: &Image, token: Option<&String>) -> Image {
|
|||||||
request = request.set("Authorization", &format!("Bearer {}", t));
|
request = request.set("Authorization", &format!("Bearer {}", t));
|
||||||
}
|
}
|
||||||
let raw_response = match request
|
let raw_response = match request
|
||||||
.set("Accept", "application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.index.v1+json")
|
.set("Accept", "application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.index.v1+json")
|
||||||
.call()
|
.call()
|
||||||
{
|
{
|
||||||
Ok(response) => response,
|
Ok(response) => response,
|
||||||
@@ -82,7 +82,7 @@ pub fn get_token(images: Vec<&Image>, auth_url: &str) -> String {
|
|||||||
final_url = format!("{}&scope=repository:{}:pull", final_url, image.repository);
|
final_url = format!("{}&scope=repository:{}:pull", final_url, image.repository);
|
||||||
}
|
}
|
||||||
let raw_response = match ureq::get(&final_url)
|
let raw_response = match ureq::get(&final_url)
|
||||||
.set("Accept", "application/vnd.oci.image.index.v1+json")
|
.set("Accept", "application/vnd.oci.image.index.v1+json") // Seems to be unnecesarry. Will probably remove in the future
|
||||||
.call()
|
.call()
|
||||||
{
|
{
|
||||||
Ok(response) => match response.into_string() {
|
Ok(response) => match response.into_string() {
|
||||||
|
|||||||
Reference in New Issue
Block a user