This repository has been archived by the owner on May 31, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Read version from environment variable (#46)
* #40 - Increase version * Change direct version usage to GHACU_VERSION env var * Fix pwsh script in CI (latest) * Fix scripts * Fix version retrieving * Fix version retrieving * Fix CI * Fix CI * Fix CI * Fix CI (2) * Use env var in *.iss files * Fix null in pwsh * Fix null in pwsh * Fix ps1 scripts
- Loading branch information
Showing
20 changed files
with
127 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,29 +33,37 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 5.0.100-preview.6.20318.15 | ||
- name: Get latest release | ||
run: | | ||
tag_name=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s $GITHUB_API_URL/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name') | ||
echo "ghacu latest version is ${tag_name:1}" | ||
echo "::set-env name=GHACU_VERSION::${tag_name:1}" | ||
shell: bash | ||
- name: Install application (Windows) | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
run: | | ||
Invoke-WebRequest -Uri https://github.com/fabasoad/ghacu/releases/download/v2.0.1/ghacu-2.0.1-win-x64.tgz -OutFile ghacu-2.0.1-win-x64.tgz | ||
tar -xvf ghacu-2.0.1-win-x64.tgz | ||
$env:Path += ";${{ github.workspace }}\ghacu-2.0.1-win-x64" | ||
Invoke-WebRequest -Uri $env:GITHUB_SERVER_URL/${{ github.repository }}/releases/download/v$env:GHACU_VERSION/ghacu-$env:GHACU_VERSION-win-x64.tgz -OutFile ghacu-$env:GHACU_VERSION-win-x64.tgz | ||
tar -xvf ghacu-$env:GHACU_VERSION-win-x64.tgz | ||
$env:Path += ";${{ github.workspace }}\ghacu-$env:GHACU_VERSION-win-x64" | ||
Write-Output "::set-env name=PATH::$env:Path" | ||
shell: pwsh | ||
- name: Install application (Linux) | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
run: | | ||
cd ~ && wget https://github.com/fabasoad/ghacu/releases/download/v2.0.1/ghacu-2.0.1-linux-x64.tgz | ||
tar -xvf ghacu-2.0.1-linux-x64.tgz | ||
chmod +x ~/ghacu-2.0.1-linux-x64/ghacu | ||
PATH=$PATH:~/ghacu-2.0.1-linux-x64 | ||
cd ~ && wget $GITHUB_SERVER_URL/${{ github.repository }}/releases/download/v$GHACU_VERSION/ghacu-$GHACU_VERSION-linux-x64.tgz | ||
tar -xvf ghacu-$GHACU_VERSION-linux-x64.tgz | ||
chmod +x ~/ghacu-$GHACU_VERSION-linux-x64/ghacu | ||
PATH=$PATH:~/ghacu-$GHACU_VERSION-linux-x64 | ||
echo "::set-env name=PATH::$PATH" | ||
shell: bash | ||
- name: Install application (MacOS) | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
run: | | ||
cd ~ && wget https://github.com/fabasoad/ghacu/releases/download/v2.0.1/ghacu-2.0.1-osx-x64.tgz | ||
tar -xvf ghacu-2.0.1-osx-x64.tgz | ||
chmod +x ~/ghacu-2.0.1-osx-x64/ghacu | ||
PATH=$PATH:~/ghacu-2.0.1-osx-x64 | ||
cd ~ && wget $GITHUB_SERVER_URL/${{ github.repository }}/releases/download/v$GHACU_VERSION/ghacu-$GHACU_VERSION-osx-x64.tgz | ||
tar -xvf ghacu-$GHACU_VERSION-osx-x64.tgz | ||
chmod +x ~/ghacu-$GHACU_VERSION-osx-x64/ghacu | ||
PATH=$PATH:~/ghacu-$GHACU_VERSION-osx-x64 | ||
echo "::set-env name=PATH::$PATH" | ||
shell: bash | ||
- name: Run GHACU | ||
run: ghacu --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,16 +47,16 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
dotnet-version: 5.0.100-preview.6.20318.15 | ||
- name: Extract version | ||
id: version | ||
- name: Get latest release | ||
run: | | ||
$Version = $([xml](Get-Content src/Ghacu.Runner/Ghacu.Runner.csproj)).Project.PropertyGroup.PackageVersion | ||
Write-Output "Current ghacu version is $Version" | ||
Write-Output "::set-output name=value::$Version" | ||
shell: pwsh | ||
tag_name=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s $GITHUB_API_URL/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name') | ||
echo "ghacu latest version is ${tag_name:1}" | ||
echo "::set-env name=GHACU_VERSION::${tag_name:1}" | ||
shell: bash | ||
- name: Build | ||
run: | | ||
dotnet clean | ||
dotnet build -c Release -p:Version=${{ steps.version.outputs.value }} | ||
dotnet build -c Release -p:Version=$GHACU_VERSION | ||
shell: bash | ||
- name: Run ghacu | ||
run: dotnet ./src/Ghacu.Runner/bin/Release/netcoreapp5.0/ghacu.dll --no-cache --repository "${{ github.workspace }}" --token ${{ secrets.GITHUB_TOKEN }} --log-level Information |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
#!/usr/bin/env bash | ||
os='linux-x64' | ||
version='2.0.1' | ||
cd ~ && wget https://github.com/fabasoad/ghacu/releases/download/v$version/ghacu-$version-$os.tgz | ||
tar -xvf ghacu-$version-$os.tgz | ||
chmod +x ~/ghacu-$version-$os/ghacu | ||
ln -sfn ~/ghacu-$version-$os/ghacu /usr/local/bin/ghacu | ||
asset=$(curl -s https://api.github.com/repos/fabasoad/ghacu/releases/latest | jq -c '.assets[] | select(.name | contains('"\"$os.tgz\""'))') | ||
cd ~ && echo ${asset} | jq -r '.browser_download_url' | xargs wget | ||
tar_name=$(echo ${asset} | jq -r '.name') | ||
tar -xvf ${tar_name} | ||
folder=$(basename ${tar_name} .tgz) | ||
PATH=$PATH:~/${folder} | ||
chmod +x ~/${folder}/ghacu | ||
ln -sfn ~/${folder}/ghacu /usr/local/bin/ghacu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
#!/usr/bin/env bash | ||
os='osx-x64' | ||
version='2.0.1' | ||
cd ~ && wget https://github.com/fabasoad/ghacu/releases/download/v$version/ghacu-$version-$os.tgz | ||
tar -xvf ghacu-$version-$os.tgz | ||
chmod +x ~/ghacu-$version-$os/ghacu | ||
ln -sfn ~/ghacu-$version-$os/ghacu /usr/local/bin/ghacu | ||
asset=$(curl -s https://api.github.com/repos/fabasoad/ghacu/releases/latest | jq -c '.assets[] | select(.name | contains('"\"$os.tgz\""'))') | ||
cd ~ && echo ${asset} | jq -r '.browser_download_url' | xargs wget | ||
tar_name=$(echo ${asset} | jq -r '.name') | ||
tar -xvf ${tar_name} | ||
folder=$(basename ${tar_name} .tgz) | ||
PATH=$PATH:~/${folder} | ||
chmod +x ~/${folder}/ghacu | ||
ln -sfn ~/${folder}/ghacu /usr/local/bin/ghacu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
$version = '2.0.1' | ||
$os = 'win-x64' | ||
Invoke-WebRequest -Uri "https://github.com/fabasoad/ghacu/releases/download/v$version/ghacu-$version-$os.tgz" -OutFile "~\ghacu-$version-$os.tgz" | ||
cd ~ && tar -xf "ghacu-$version-$os.tgz" | ||
$release = Invoke-WebRequest -Uri "https://api.github.com/repos/fabasoad/ghacu/releases/latest" | ConvertFrom-Json | ||
$asset = $null | ||
For ($i = 0; $i -lt $release.assets.Length; $i++) | ||
{ | ||
If ($release.assets[$i].name -like "*$os.tgz") | ||
{ | ||
$asset = $release.assets[$i] | ||
break | ||
} | ||
} | ||
$asset_name = $asset.name | ||
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile "~\$asset_name" | ||
cd ~ && tar -xf $asset_name | ||
$folder = [io.path]::GetFileNameWithoutExtension($asset_name) | ||
$path = (Resolve-Path ~) | ||
New-Item -ItemType SymbolicLink -Path C:\Windows\System32\ghacu.exe -Value $path\ghacu-$version-$os\ghacu.exe -Force | ||
$env:Path += ";$path\$folder" | ||
New-Item -ItemType SymbolicLink -Path C:\Windows\System32\ghacu.exe -Value $path\$folder\ghacu.exe -Force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
$version = '2.0.1' | ||
$os = 'win-x86' | ||
Invoke-WebRequest -Uri "https://github.com/fabasoad/ghacu/releases/download/v$version/ghacu-$version-$os.tgz" -OutFile "~\ghacu-$version-$os.tgz" | ||
cd ~ && tar -xf "ghacu-$version-$os.tgz" | ||
$release = Invoke-WebRequest -Uri "https://api.github.com/repos/fabasoad/ghacu/releases/latest" | ConvertFrom-Json | ||
$asset = $null | ||
For ($i = 0; $i -lt $release.assets.Length; $i++) | ||
{ | ||
If ($release.assets[$i].name -like "*$os.tgz") | ||
{ | ||
$asset = $release.assets[$i] | ||
break | ||
} | ||
} | ||
$asset_name = $asset.name | ||
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile "~\$asset_name" | ||
cd ~ && tar -xf $asset_name | ||
$folder = [io.path]::GetFileNameWithoutExtension($asset_name) | ||
$path = (Resolve-Path ~) | ||
New-Item -ItemType SymbolicLink -Path C:\Windows\System32\ghacu.exe -Value $path\ghacu-$version-$os\ghacu.exe -Force | ||
$env:Path += ";$path\$folder" | ||
New-Item -ItemType SymbolicLink -Path C:\Windows\System32\ghacu.exe -Value $path\$folder\ghacu.exe -Force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.