From 0ea39b55427a07232bdf32c029ef8c9f29852570 Mon Sep 17 00:00:00 2001 From: Michael Lohmann Date: Mon, 1 Dec 2025 10:22:41 +0100 Subject: [PATCH] github-actions: create releases instead of uploading artifacts --- .github/workflows/build.yml | 27 --------------------------- .github/workflows/release.yml | 26 ++++++++++++++++++++++++++ README.md | 5 +++-- 3 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 8d06f9c..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Build - -on: - push: - branches: - - main -jobs: - tests: - runs-on: ubuntu-latest - steps: - - name: Check out repository code - # uses: actions/checkout@v5 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 - - name: build - run: ./build.sh --verbose - - name: create tarball - # GitHub removes file permissions, but we need them to be there - # https://github.com/actions/upload-artifact/blob/cf8714cfeaba5687a442b9bcb85b29e23f468dfa/README.md#permission-loss - # Alternatively we could require the user to run a script that adds the permissions on first run, but that also feels broken... - run: tar -cvf tutorial.tar ./tutorial/ - - name: upload tutorial - # uses: actions/upload-artifact@v4.6.2 - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 - with: - name: tutorial - path: ./tutorial.tar - if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..01e5143 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Releases + +on: + push: + tags: + - '*' + +jobs: + + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 + - name: build + run: ./build.sh --verbose + - name: create tarball + # GitHub removes file permissions, but we need them to be there + # https://github.com/actions/upload-artifact/blob/cf8714cfeaba5687a442b9bcb85b29e23f468dfa/README.md#permission-loss + # Alternatively we could require the user to run a script that adds the permissions on first run, but that also feels broken... + run: tar -cvf tutorial.tar ./tutorial/ + - uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b + with: + artifacts: "tutorial.tar" + artifactErrorsFailBuild: true diff --git a/README.md b/README.md index ca12110..805138e 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,11 @@ into the quests (many of which are impossible in a fresh clone)… Alternatively: If you don't want to run this "build"-script yourself (it basically just executes a bunch of git commands to create the folder "tutorial" -and fills it with all the information you need), you can download it: +and fills it with all the information you need), you can download it from the +release page: https://github.com/miallo/nuggit/releases ```sh -curl https://nuggit.lohmann.sh/tutorial.zip --output tutorial.zip +cd ~/Downloads unzip tutorial.zip tar --extract --file=tutorial.tar cd tutorial