Skip to content

Commit

Permalink
fix: 💚 fix build ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zuygui committed May 23, 2023
1 parent 0ad2bf1 commit 00f2b71
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 133 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
toolchain: stable
targets: ${{ matrix.name }}

- name: Get afetch version
id: afetch_version
- name: Get flowupdater-json-creator version
id: flowupdater_json_creator_version
shell: pwsh
run: |
$version = (Get-Content .\Cargo.toml | Select-String -Pattern '^\s*version\s*=\s*"(\d+\.\d+\.\d+)"' | ForEach-Object { $_.Matches.Groups[1].Value })
Expand All @@ -56,13 +56,13 @@ jobs:
- name: Build release
run: |
cargo build --release --locked --target ${{ matrix.name }}
mv ./target/${{ matrix.name }}/release/afetch.exe ./afetch-${{ steps.afetch_version.outputs.APP_VERSION }}-${{ matrix.name }}.exe
mv ./target/${{ matrix.name }}/release/flowupdater-json-creator.exe ./flowupdater-json-creator-${{ steps.flowupdater_json_creator_version.outputs.APP_VERSION }}-${{ matrix.name }}.exe
- name: Upload executable to release
uses: softprops/action-gh-release@v1
with:
files: afetch-${{ steps.afetch_version.outputs.APP_VERSION }}-${{ matrix.name }}.exe
tag_name: ${{ steps.afetch_version.outputs.APP_VERSION }}
files: flowupdater-json-creator-${{ steps.flowupdater_json_creator_version.outputs.APP_VERSION }}-${{ matrix.name }}.exe
tag_name: ${{ steps.flowupdater_json_creator_version.outputs.APP_VERSION }}

generate-linux-freebsd-executables:
name: Build & publish for ${{ matrix.target }}
Expand Down Expand Up @@ -128,20 +128,20 @@ jobs:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Get afetch version
id: afetch_version
- name: Get flowupdater-json-creator version
id: flowupdater_json_creator_version
run: echo "APP_VERSION=$(awk -F ' = ' '$1 ~ /version/ { gsub(/["]/, "", $2); printf("%s",$2) }' Cargo.toml)" >> $GITHUB_OUTPUT

- name: Build release
run: |
cargo build --release --locked --target ${{ matrix.target }}
mv ./target/${{ matrix.target }}/release/afetch ./afetch-${{ steps.afetch_version.outputs.APP_VERSION }}-${{ matrix.target }}
mv ./target/${{ matrix.target }}/release/flowupdater-json-creator ./flowupdater-json-creator-${{ steps.flowupdater_json_creator_version.outputs.APP_VERSION }}-${{ matrix.target }}
- name: Upload executable to release
uses: softprops/action-gh-release@v1
with:
files: afetch-${{ steps.afetch_version.outputs.APP_VERSION }}-${{ matrix.target }}
tag_name: ${{ steps.afetch_version.outputs.APP_VERSION }}
files: flowupdater-json-creator-${{ steps.flowupdater_json_creator_version.outputs.APP_VERSION }}-${{ matrix.target }}
tag_name: ${{ steps.flowupdater_json_creator_version.outputs.APP_VERSION }}

generate-macos-executables:
name: Build & publish for ${{ matrix.name }}
Expand All @@ -161,8 +161,8 @@ jobs:
toolchain: stable
targets: ${{ matrix.name }}

- name: Get AFetch version
id: afetch_version
- name: Get flowupdater-json-creator version
id: flowupdater_json_creator_version
run: echo "APP_VERSION=$(awk -F ' = ' '$1 ~ /version/ { gsub(/["]/, "", $2); printf("%s",$2) }' Cargo.toml)" >> $GITHUB_OUTPUT

- name: Set up cargo cache
Expand All @@ -181,9 +181,9 @@ jobs:
- name: Build release
run: |
cargo build --release --locked --target ${{ matrix.name }}
mv ./target/${{ matrix.name }}/release/afetch ./afetch-${{ steps.afetch_version.outputs.APP_VERSION }}-${{ matrix.name }}
mv ./target/${{ matrix.name }}/release/flowupdater-json-creator ./flowupdater-json-creator-${{ steps.flowupdater_json_creator_version.outputs.APP_VERSION }}-${{ matrix.name }}
- name: Upload executable to release
uses: softprops/action-gh-release@v1
with:
files: afetch-${{ steps.afetch_version.outputs.APP_VERSION }}-${{ matrix.name }}
tag_name: ${{ steps.afetch_version.outputs.APP_VERSION }}
files: flowupdater-json-creator-${{ steps.flowupdater_json_creator_version.outputs.APP_VERSION }}-${{ matrix.name }}
tag_name: ${{ steps.flowupdater_json_creator_version.outputs.APP_VERSION }}
126 changes: 11 additions & 115 deletions Cargo.lock

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

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ categories = ["command-line-utilities", "development-tools"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio = { version = "1", default-features = false, features = ["rt-multi-thread", "macros"] }
reqwest = { version = "0.11", features = ["json", "rustls-tls"] }
serde = { version = "1", features = ["derive"] }
tokio = { version = "1", default-features = false, features = ["rt-multi-thread", "macros"] }
openssl = { version = "0.10", features = ["vendored"] }
serde = { version = "1", features = ["derive"] }
reqwest = { version = "0.11", features = ["json"] }
serde_json = { version = "1.0.96" }
requestty = { version = "0.5.0" }

Expand Down

0 comments on commit 00f2b71

Please sign in to comment.