From 35c6f83826a875dd29130f5f437c1b6ad0696365 Mon Sep 17 00:00:00 2001 From: Masaharu TASHIRO Date: Fri, 31 Mar 2023 15:23:25 +0900 Subject: [PATCH] configure project --- .github/workflows/permission-check.yml | 60 ++++++++++++++++++++++++++ .gitignore | 1 + renovate.json5 | 5 +++ 3 files changed, 66 insertions(+) create mode 100644 .github/workflows/permission-check.yml create mode 100644 .gitignore create mode 100644 renovate.json5 diff --git a/.github/workflows/permission-check.yml b/.github/workflows/permission-check.yml new file mode 100644 index 0000000..012de50 --- /dev/null +++ b/.github/workflows/permission-check.yml @@ -0,0 +1,60 @@ +name: release +on: + push: + +jobs: + release: + name: Create release + runs-on: ubuntu-latest + permissions: + contents: write + env: + GH_REPO: ${{ github.repository }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + outputs: + release_tag: ${{ steps.release_tag.outputs.release_tag }} + steps: + - id: release_tag + run: | + release_url=$(gh release create "v-${GITHUB_SHA}" --draft) + release_tag=$(echo $release_url | sed -r "s|^${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/tag/(.*)$|\1|") + echo "release_tag=${release_tag}" >> "$GITHUB_OUTPUT" + sleep 1 + + rename: + name: Rename release title + needs: release + runs-on: ubuntu-latest + permissions: + contents: write + env: + GH_REPO: ${{ github.repository }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - run: gh release edit ${{ needs.release.outputs.release_tag }} --title "Release v-${GITHUB_SHA}" + + upload: + name: Upload executables + runs-on: ubuntu-latest + needs: release + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + - run: echo "hoge" > attachment.txt + - name: Upload executables + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload ${{ needs.release.outputs.release_tag }} attachment.txt + + publish: + name: Publish release + runs-on: ubuntu-latest + needs: [release, rename, upload] + env: + GH_REPO: ${{ github.repository }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - run: gh release edit ${{ needs.release.outputs.release_tag }} --draft=false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/renovate.json5 b/renovate.json5 new file mode 100644 index 0000000..5fd161d --- /dev/null +++ b/renovate.json5 @@ -0,0 +1,5 @@ +{ + extends: [ + "github>mshrtsr/renovate-config", + ] +}