Skip to content

Commit

Permalink
Automatically attaching cypress-moon binaries to release page (fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
vania-pooh committed Jan 22, 2024
1 parent f796703 commit d0bf804
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
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 }}
19 changes: 19 additions & 0 deletions ci/download.sh
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

0 comments on commit d0bf804

Please sign in to comment.