v1.1.5 #1
Workflow file for this run
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
name: Build and Upload | |
on: | |
workflow_dispatch: # This allows you to manually trigger the workflow | |
release: | |
types: [published] # This triggers the workflow when a release is published | |
jobs: | |
build-and-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y git curl u-boot-tools ca-certificates gnupg zip | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' # Set up the Python version you need | |
- name: Run build script | |
run: | | |
chmod +x ./build_image.sh | |
bash ./build_image.sh | |
- name: Get Release | |
id: get-release | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
const release = await github.repos.getLatestRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
}); | |
return release.data.upload_url; | |
- name: Upload to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get-release.outputs.upload_url }} # This pulls from the GET RELEASE step above | |
asset_path: ./build/update.zip | |
asset_name: update.zip | |
asset_content_type: application/zip |