From 9d4931cd1bb800f82221d0c3f7495cbb76331e55 Mon Sep 17 00:00:00 2001 From: dearblue Date: Thu, 28 Dec 2023 22:43:12 +0900 Subject: [PATCH] Create source code packages by adding release tags According to the [GitHub blog](https://github.blog/2023-02-21-update-on-the-future-stability-of-source-code-archives-and-hashes/), files by `git archive` are not guaranteed to have checksum persistence. It is also stated that the archive file at this time is stable in bytes, but that this may change in the future. --- .github/workflows/release.yml | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..719872f5cc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: Release Builds + +on: + push: + tags: + - "*.*.*" + +permissions: read-all + +jobs: + source: + name: Source Code Releasing + if: ${{ github.repository == 'mruby/mruby' }} + permissions: + contents: write + runs-on: ubuntu-22.04 + timeout-minutes: 10 + strategy: + fail-fast: false + steps: + - name: "Checkout ${{ github.ref_name }} ( ${{ github.sha }} )" + uses: actions/checkout@v4 + - name: Builds + id: builds + run: | + tagname="$GITHUB_REF_NAME" + packagename="mruby-$tagname" + destdir=packages + + mkdir -p "$destdir" + git archive --format zip --prefix "$packagename/" -o "$destdir/$packagename.zip" "$GITHUB_REF" + git archive --format tar.gz --prefix "$packagename/" -o "$destdir/$packagename.tar.gz" "$GITHUB_REF" + gunzip -c "$destdir/$packagename.tar.gz" | xz > "$destdir/$packagename.tar.xz" + + ( + cd "$destdir" + sha256sum * > .sha256 + mv .sha256 "$packagename.sha256" + ) + - name: Release + uses: softprops/action-gh-release@v1 + with: + # draft: true + prerelease: ${{ contains(github.ref_name, '-rc') }} + body_path: NEWS + files: packages/*