-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da26917
commit 0321d04
Showing
2 changed files
with
54 additions
and
13 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Chocolatey Deploy | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
chocolatey: | ||
name: Deploy | ||
runs-on: windows-latest | ||
if: github.repository == 'marianina8/timetravel' | ||
steps: | ||
- name: Clone Repository | ||
uses: actions/checkout@v4 | ||
- uses: oprypin/find-latest-tag@v1 | ||
with: | ||
repository: ${{ github.repository }} # The repository to scan. | ||
releases-only: true # We know that all relevant tags have a GitHub release for them. | ||
id: latesttag | ||
- name: Set Checksum | ||
run: | | ||
filename="timetravel.exe" | ||
url="https://github.com/${{ github.repository }}/releases/download/${{ steps.latesttag.outputs.tag }}/${filename}" | ||
sed -i "s#{URL64}#${url}#g" "Assets/Choco/timetravel/tools/chocolateyinstall.ps1" | ||
curl -sSL "${url}" -o "Assets/Choco/${filename}" | ||
sha256=$(cat "Assets/Choco/${filename}" | sha256sum -) | ||
sed -i "s/{SHA256CHECKSUM64}/${sha256:0:64}/g" "Assets/Choco/timetravel/tools/chocolateyinstall.ps1" | ||
- name: Set Version | ||
id: version | ||
run: | | ||
version=${{ steps.latesttag.outputs.tag }} | ||
echo "nuget=$version" >> $GITHUB_OUTPUT | ||
sed -i "s/{VERSION}/${version}/g" "Assets/Choco/timetravel/timetravel.nuspec" | ||
- name: Choco Downgrade | ||
uses: crazy-max/ghaction-chocolatey@v3 | ||
with: | ||
args: install chocolatey --version=1.2.1 --allow-downgrade -y -r --no-progress | ||
- name: Pack Release | ||
uses: crazy-max/ghaction-chocolatey@v3 | ||
with: | ||
args: pack Assets/Choco/timetravel/timetravel.nuspec --outputdirectory Assets/Choco/timetravel | ||
- name: Choco Upgrade | ||
uses: crazy-max/ghaction-chocolatey@v3 | ||
with: | ||
args: upgrade chocolatey | ||
- name: Upload Release | ||
uses: crazy-max/ghaction-chocolatey@v3 | ||
with: | ||
args: push Assets/Choco/timetravel/timetravel.${{ steps.version.outputs.nuget }}.nupkg -s https://push.chocolatey.org/ -k ${{ secrets.CHOCO_KEY }} |
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