Update test.yml #4
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: Run build | |
"on": | |
push: | |
paths-ignored: | |
- README.md | |
- COPYING | |
pull_request: | |
release: | |
types: | |
- published | |
- prereleased | |
schedule: | |
- cron: '0 16 * * 5' | |
workflow_dispatch: # Allows manually triggering | |
env: | |
PP_IMAGE: /dev/loop10 | |
FED_IMAGE: /dev/loop11 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v2 | |
- name: Makes extra disk space | |
uses: nikhiljha/make-space@v1 | |
- name: Install necessary tools | |
run: | | |
sudo apt update | |
sudo apt install -yy systemd-container qemu-user-static u-boot-tools btrfs-progs dosfstools xz-utils sssd | |
sudo service sssd start | |
- name: Download files | |
run: | | |
set -ex -o pipefail | |
./download-files.sh | |
- name: Execute build | |
run: | | |
set -ex -o pipefail | |
sudo -E ./all.sh | |
# Compress image | |
sudo xz -T 0 fedora.img | |
- name: Store fedora.img.xz as an artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: image | |
path: fedora.img.xz | |
if-no-files-found: error | |
release: | |
needs: | |
- build # Can only run after the build has created the artifact | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' | |
steps: | |
- name: Download fedora.img.xz | |
uses: actions/download-artifact@v4 | |
with: | |
name: image | |
- name: Upload files to release | |
uses: nikhiljha/release-action@v1 | |
with: | |
artifacts: fedora.img.xz | |
allowUpdates: true | |
name: ${{ github.event.name }} | |
token: ${{ secrets.GITHUB_TOKEN }} |