From 3b7cf3695cfbe11006037c2d55cd2ebc705e787a Mon Sep 17 00:00:00 2001 From: max-ishere <47008271+max-ishere@users.noreply.github.com> Date: Tue, 3 Dec 2024 00:59:32 +0200 Subject: [PATCH] Attempt to setup release CI --- .github/workflows/build-release.yml | 69 +++++++++++++++++++++++++++++ flake.lock | 19 ++++---- flake.nix | 6 ++- 3 files changed, 83 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/build-release.yml diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 0000000..ff49eb7 --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,69 @@ +name: "Build release" +on: + pull_request: + push: + workflow_dispatch: +permissions: + contents: write +jobs: + build: + runs-on: ubuntu-latest + name: nix build + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v27 + with: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + - run: nix build .#_ci.release + - id: zip + run: | + ref="${{github.ref_name}}" + ref="${ref//\//.}" + + release="grubshin-bootpact-$ref" + cp -rL result "$release" + + artefact="grubshin-bootpact-$ref.zip" + zip -r "$artefact" "$release" + + echo "artefact=$artefact" >> "$GITHUB_OUTPUT" + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: TEST Release ${{ github.ref_name }} + tag_name: ${{ github.ref_name }} + draft: true # ${{ !startsWith(github.ref, 'refs/tags/') }} + body: | + # Version ${{ github.ref_name }} Released! + + ## Installation + + Here is the TLDR of the installation instructions (Full instuctions): + + - Download the release zip (`${{ steps.zip.outputs.artefact }}`). It contains all the variants of the theme. + - Unzip and copy the variant you like to `/boot/grub/themes/grubshin-bootpact`. + > [!IMPORTANT] + > Make sure that after the theme is copied `theme.txt` is in + > `/boot/grub/themes/grubshin-bootpact/theme.txt`. Otherwise GRUB will not be able to find it. + - Add this to `/etc/default/grub`: + ``` + GRUB_THEME="/boot/grub/themes/grubshin-bootpact/theme.txt" + ``` + + If its your first time installing see the full instructions using the link above. + + > [!TIP] + > You can install multiple variants of the theme but only 1 can be active. Select the variant by + > changing the `GRUB_THEME` variable in `/etc/default/grub` + + + + discussion_category_name: announcements + generate_release_notes: true + fail_on_unmatched_files: true + files: | + ${{ steps.zip.outputs.artefact }} \ No newline at end of file diff --git a/flake.lock b/flake.lock index 1a5d80d..10c6aad 100644 --- a/flake.lock +++ b/flake.lock @@ -9,15 +9,16 @@ "locked": { "lastModified": 1733163819, "narHash": "sha256-fC+v0YIcU/lY0Hu9qCZIhT6Pc9uJUclC31kQ0Gg2vjo=", - "ref": "refs/heads/main", + "owner": "max-ishere", + "repo": "grub-theme.nix", "rev": "9e0c57a412d72e97487f40d8569d3910d41cbc74", - "revCount": 2, - "type": "git", - "url": "file:///home/max_ishere/Projects/grub-theme.nix" + "type": "github" }, "original": { - "type": "git", - "url": "file:///home/max_ishere/Projects/grub-theme.nix" + "owner": "max-ishere", + "ref": "main", + "repo": "grub-theme.nix", + "type": "github" } }, "hywenhei-extended-font": { @@ -39,11 +40,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732837521, - "narHash": "sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE=", + "lastModified": 1733015953, + "narHash": "sha256-t4BBVpwG9B4hLgc6GUBuj3cjU7lP/PJfpTHuSqE+crk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "970e93b9f82e2a0f3675757eb0bfc73297cc6370", + "rev": "ac35b104800bff9028425fec3b6e8a41de2bbfff", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 4ce373f..ff1540b 100644 --- a/flake.nix +++ b/flake.nix @@ -3,8 +3,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; - # grubTheme.url = "github:max-ishere/grub-theme.nix?ref=main"; - grubTheme.url = "/home/max_ishere/Projects/grub-theme.nix"; + grubTheme.url = "github:max-ishere/grub-theme.nix?ref=main"; grubTheme.inputs.nixpkgs.follows = "nixpkgs"; hywenhei-extended-font = { url = "github:cawa-93/HYWenHei-Extended-Font?ref=main"; @@ -52,6 +51,9 @@ vscodevim.vim jnoortheen.nix-ide ms-vscode.hexeditor + github.vscode-github-actions + bierner.markdown-preview-github-styles + #me-dutour-mathieu.vscode-github-actions ]; }) nixd