Skip to content

Commit

Permalink
Create build.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
theCode-Breaker authored Feb 17, 2022
1 parent 53e1db0 commit e7ff06d
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build Arch ISO

on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60

permissions:
contents: write

container:
image: archlinux:latest
options: --privileged

steps:
- uses: actions/checkout@v2

- name: Set current date as environment variable
run: echo "DATE=`date +'%Y.%m.%d'`" >>$GITHUB_ENV

- name: Create temporary build directory
run: mkdir -p /tmp/$DATE/airootfs/root/

- name: Add notes to .zprofile
run: |
echo ". /usr/share/makepkg/util/message.sh" >>/tmp/$DATE/airootfs/root/.zprofile
echo -e "colorize\n" >>/tmp/$DATE/airootfs/root/.zprofile
echo "msg \"This is an unofficial ISO created by GitHub Actions on $DATE from run ID $GITHUB_RUN_ID\"" >>/tmp/$DATE/airootfs/root/.zprofile
echo "msg2 \"Check $GITHUB_SERVER_URL/$GITHUB_REPOSITORY#readme for more details\"" >>/tmp/$DATE/airootfs/root/.zprofile
echo "echo \"\"" >>/tmp/$DATE/airootfs/root/.zprofile
- name: Update packages and install archiso
run: pacman -Syu --noconfirm archiso

- name: Copy profile to build directory
run: cp -r /usr/share/archiso/configs/releng/* /tmp/$DATE

- name: Build ISO
run: mkarchiso -v -w work/ -o ./ /tmp/$DATE

- name: Generate release Markdown file
run: |
echo "\`MD5:\` \``md5sum archlinux-$DATE-x86_64.iso`\`" >>RELEASE.md
echo "\`SHA1:\` \``sha1sum archlinux-$DATE-x86_64.iso`\`" >>RELEASE.md
- name: Create tag and release
uses: ncipollo/release-action@v1
with:
name: Arch Linux ${{ env.DATE }}
tag: ${{ env.DATE }}
commit: main
bodyFile: RELEASE.md
artifacts: "archlinux-${{ env.DATE }}-x86_64.iso"
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit e7ff06d

Please sign in to comment.