Skip to content

Commit

Permalink
chore: update beta.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
chenfan0 committed Aug 28, 2024
1 parent 0c9d49c commit c189ac6
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,40 @@ jobs:
with:
name: build-mac-arm-${{ env.VERSION }}-beta
path: dist/fideo-${{ env.VERSION }}-arm64.dmg
- name: Create release on GitLab
env:
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
GITLAB_PROJECT_ID: ${{ secrets.GITLAB_PROJECT_ID }}
run: |
# Define variables
RELEASE_TAG=${{ env.VERSION }}-beta
RELEASE_NAME="Release $RELEASE_TAG"
RELEASE_DESCRIPTION="Automated release for version $RELEASE_TAG"
# Upload Windows artifact to GitLab as a release asset
WIN_ASSET_URL=$(curl --request POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
--form "file=@dist/fideo-${{ env.VERSION }}.exe" \
"https://gitlab.com/api/v4/projects/$GITLAB_PROJECT_ID/uploads" | jq -r '.url')
# Upload macOS x64 artifact to GitLab as a release asset
MAC_X64_ASSET_URL=$(curl --request POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
--form "file=@dist/fideo-${{ env.VERSION }}-x64.dmg" \
"https://gitlab.com/api/v4/projects/$GITLAB_PROJECT_ID/uploads" | jq -r '.url')
# Upload macOS arm artifact to GitLab as a release asset
MAC_ARM_ASSET_URL=$(curl --request POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
--form "file=@dist/fideo-${{ env.VERSION }}-arm64.dmg" \
"https://gitlab.com/api/v4/projects/$GITLAB_PROJECT_ID/uploads" | jq -r '.url')
# Create a release on GitLab
curl --request POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
--data "name=$RELEASE_NAME" \
--data "tag_name=$RELEASE_TAG" \
--data "description=$RELEASE_DESCRIPTION" \
--data "assets[links][][name]=Windows" \
--data "assets[links][][url]=https://gitlab.com/$GITLAB_PROJECT_ID/uploads/$WIN_ASSET_URL" \
--data "assets[links][][name]=macOS x64" \
--data "assets[links][][url]=https://gitlab.com/$GITLAB_PROJECT_ID/uploads/$MAC_X64_ASSET_URL" \
--data "assets[links][][name]=macOS ARM" \
--data "assets[links][][url]=https://gitlab.com/$GITLAB_PROJECT_ID/uploads/$MAC_ARM_ASSET_URL" \
"https://gitlab.com/api/v4/projects/$GITLAB_PROJECT_ID/releases"

0 comments on commit c189ac6

Please sign in to comment.