-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically attaching cypress-moon binaries to release page (fixes #…
…403)
- Loading branch information
1 parent
f796703
commit d0bf804
Showing
2 changed files
with
42 additions
and
0 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,23 @@ | ||
name: release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
moon: | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'aerokube/moon' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Prepare release version | ||
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV | ||
|
||
- name: Download and extract release | ||
run: ci/download.sh $RELEASE_VERSION | ||
|
||
- uses: AButler/[email protected] | ||
with: | ||
files: 'dist/*' | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
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,19 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
VERSION=$1 | ||
|
||
mkdir -p dist | ||
cd dist | ||
for osArch in "linux_amd64" "darwin_amd64" "darwin_arm64" "windows_amd64" "windows_386"; do | ||
os=$(echo "$osArch" | awk -F "_" '{print $1;}') | ||
file='cypress-moon_'"$osArch" | ||
downloadURL="https://github.com/aerokube/moon2/releases/download/$VERSION/cypress-moon_darwin_amd64" | ||
outputFile="cypress-moon_$osArch" | ||
if [ "$os" == "windows" ]; then | ||
downloadURL="$downloadURL.exe" | ||
outputFile="$outputFile.exe" | ||
fi | ||
curl -o "$outputFile" -s "$downloadURL" | ||
chmod 755 "$outputFile" | ||
done |