From e6bd49ef67eb7c712787df018dd87a02a3d9de99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valt=C3=BDr=20=C3=96rn=20Kjartansson?= Date: Wed, 16 Jun 2021 12:11:38 +0000 Subject: [PATCH] Github actions --- .github/workflows/generateBuild/action.yml | 12 +++++ .github/workflows/generateBuild/build.sh | 1 + .github/workflows/main.yml | 58 ++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 .github/workflows/generateBuild/action.yml create mode 100644 .github/workflows/generateBuild/build.sh create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/generateBuild/action.yml b/.github/workflows/generateBuild/action.yml new file mode 100644 index 0000000..164f503 --- /dev/null +++ b/.github/workflows/generateBuild/action.yml @@ -0,0 +1,12 @@ +# action.yml +name: "Build popcorn" +description: "Generate an iso from popcorn source" +outputs: + time: # id of output + description: "The time we greeted you" +runs: + using: "docker" + image: "valtyr/popcorn-buildenv:latest" + entrypoint: "/bin/bash" + args: + - "./.github/workflows/generateBuild/build.sh" diff --git a/.github/workflows/generateBuild/build.sh b/.github/workflows/generateBuild/build.sh new file mode 100644 index 0000000..1675da8 --- /dev/null +++ b/.github/workflows/generateBuild/build.sh @@ -0,0 +1 @@ +make build-x86_64 \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..71552e5 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,58 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [master] + pull_request: + branches: [master] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + name: Generate artifacts + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Generate build + uses: ./.github/workflows/generateBuild + + # - name: Generate web + # run: ./build_web.sh + + # - name: Deploy web + # uses: peaceiris/actions-gh-pages@v3 + # with: + # github_token: ${{ secrets.GITHUB_TOKEN }} + # publish_dir: /build + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: release_${{ github.sha }} + release_name: Release ${{ github.sha }} + draft: false + prerelease: false + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + 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: ./dist/x86_64/kernel.iso + asset_name: kernel.iso + asset_content_type: application/octet-stream