Skip to content

Commit

Permalink
selfhosted.yml: Use actions/create-release@v1 as a workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
sounddrill31 committed Mar 27, 2024
1 parent 9d54d5f commit fb349e3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Expand Up @@ -329,7 +329,7 @@ jobs:
crave pull out/error.log
# For Upload compatibility
cp -r ${{ github.event.inputs.DEVICE_NAME }} $OLDDIR
cp -r out $OLDDIR
# Upload Errors
- name: Upload error.log
Expand Down
38 changes: 22 additions & 16 deletions .github/workflows/selfhosted.yml
Expand Up @@ -353,25 +353,31 @@ jobs:
crave pull out/target/product/*/*.img
# For Upload compatibility
cp -r ${{ github.event.inputs.DEVICE_NAME }} $OLDDIR
# cp -r ${{ github.event.inputs.DEVICE_NAME }}/* $OLDDIR
# Directly upload to releases.
- name: Upload to repository's releases page
uses: softprops/action-gh-release@v1
# Create Github releases.
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
${{ github.event.inputs.DEVICE_NAME }}/recovery.img
${{ github.event.inputs.DEVICE_NAME }}/boot.img
${{ github.event.inputs.DEVICE_NAME }}/vendor_boot.img
${{ github.event.inputs.DEVICE_NAME }}/vendor.img
${{ github.event.inputs.DEVICE_NAME }}/system.img
${{ github.event.inputs.DEVICE_NAME }}/*.zip
name: ${{ github.event.inputs.PRODUCT_NAME }}-${{ github.run_id }}
tag_name: ${{ github.run_id }}
body: |
Target: ${{ github.event.inputs.PRODUCT_NAME }}-${{ github.event.inputs.BUILD_TYPE }}
release_name: ${{ github.event.inputs.PRODUCT_NAME }}-${{ github.run_id }}
draft: false
prerelease: false

# Upload to Github releases.
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: $(find "$PROJECTFOLDER/${{ github.event.inputs.DEVICE_NAME }}" -type f -name '*.zip' -exec realpath {} \;)
asset_name: $(find "$PROJECTFOLDER/${{ github.event.inputs.DEVICE_NAME }}" -type f -name '*.zip' -exec basename {} \;)
asset_content_type: application/zip

# Pull Errors
- name: Pull error.log
Expand All @@ -383,7 +389,7 @@ jobs:
crave pull out/error.log
# For Upload compatibility
cp -r ${{ github.event.inputs.DEVICE_NAME }} $OLDDIR
cp -r out $OLDDIR
# Upload Errors
- name: Upload error.log
Expand Down

0 comments on commit fb349e3

Please sign in to comment.