From f679b79e778278804c59a866d0c24468316f8915 Mon Sep 17 00:00:00 2001 From: Lucas Garron Date: Mon, 15 Jan 2024 15:32:44 -0800 Subject: [PATCH] Switch to `cubing/actions-workflows` for releases. --- .github/workflows/publish-github-release.yaml | 13 +++++++ .github/workflows/release.yml | 39 ------------------- 2 files changed, 13 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/publish-github-release.yaml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/publish-github-release.yaml b/.github/workflows/publish-github-release.yaml new file mode 100644 index 0000000..d6df887 --- /dev/null +++ b/.github/workflows/publish-github-release.yaml @@ -0,0 +1,13 @@ +name: Publish GitHub release + +on: + push: + tags: + - v* + +jobs: + Publish: + permissions: + contents: write + if: startsWith(github.ref, 'refs/tags/v') + uses: cubing/actions-workflows/.github/workflows/publish-github-release.yaml@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 72164ef..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: GitHub Release - -on: - push: - tags: - - v* - -jobs: - create-github-release: - permissions: - contents: write - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/v') - steps: - - name: Calculate release name - run: | - GITHUB_REF=${{ github.ref }} - RELEASE_NAME=${GITHUB_REF#"refs/tags/"} - echo "RELEASE_NAME=${RELEASE_NAME}" >> $GITHUB_ENV - # We'd use `github.event.head_commit.message`, but that includes the first line of the message. So we check out the code. - - name: Check out code for release body calculation using `git` itself - uses: actions/checkout@v3 - - name: Calculate release body - run: | - # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-a-multiline-string - EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) - echo "RELEASE_BODY<<$EOF" >> $GITHUB_ENV - git log --format=%b -n 1 HEAD >> $GITHUB_ENV - echo "$EOF" >> $GITHUB_ENV - - name: Publish release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ env.RELEASE_NAME }} - body: ${{ env.RELEASE_BODY }} - draft: false - prerelease: false