From a8c62a8b473ea01d0ce048124f0f6b6ca8bc3adf Mon Sep 17 00:00:00 2001 From: mass0910 Date: Sun, 1 Oct 2023 04:24:29 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9=E8=87=AA?= =?UTF-8?q?=E5=8B=95=E5=8C=96=E3=83=AF=E3=83=BC=E3=82=AF=E3=83=95=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 88 +++++++++++++++++++++++++++++++++++ 1 file changed, 88 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 0000000..df7dd70 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,88 @@ +name: release + +on: + push: + tags: + - 'v*' + +jobs: + test: + name: リリース作業 + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + + - name: cache HSP3.6 + id: cache-hsp36 + uses: actions/cache@v3 + with: + path: C:/hsp36 + key: ${{ runner.os }}-hsp36 + restore-keys: | + ${{ runner.os }}-hsp36 + + - name: download HSP3.6 + if: ${{ steps.cache-hsp36.outputs.cache-hit != 'true' }} + uses: robinraju/release-downloader@v1.4 + with: + repository: "onitama/OpenHSP" + tag: "v3.6" + fileName: "hsp36en.zip" + + - name: unzip hsp36en.zip + if: ${{ steps.cache-hsp36.outputs.cache-hit != 'true' }} + run: 7z x hsp36en.zip -oC:/ + + - name: add hsp36 to path + shell: pwsh + run: echo "C:/hsp36" >> $env:GITHUB_PATH + + - name: compile hsptest + shell: pwsh + run: | + hspcmp -o"compile.ax" --compath="C:/hsp36/common" ./compile.hsp + cp common/* C:/hsp36/common/ + hsp3cl compile.ax + + - name: create artifact zip file + shell: pwsh + run: | + mkdir hsptest + Copy-Item -Recurse -Path common -Destination hsptest/common + Copy-Item -Path hsptest.exe -Destination hsptest + Copy-Item -Path install.bat -Destination hsptest + Copy-Item -Path run_hsptest.bat -Destination hsptest + 7z a -tzip hsptest.zip hsptest + + - name: get previout tag name + id: get_previous_tag + shell: bash + run: | + git fetch -a + echo value=$(git tag --sort "-committerdate" | cut -d$'\n' -f2) >> $GITHUB_OUTPUT + + - name: fetch auto generated release note + id: generate_release_note + shell: bash + run: | + echo "release_note=$(curl -X POST -H 'Accept: application/vnd.github.v3+json' -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{ github.repository }}/releases/generate-notes -d '{"tag_name":"${{ github.ref_name }}", "previous_tag_name":"${{ steps.get_previous_tag.outputs.value }}", "configuration_file_path":".github/release_note.yml"}' | jq .body | sed 's/"//g' | sed s/\\\\n/\\$'\n'/g)" >> generated_release_note.txt + + - name: create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: hsptest ${{ github.ref_name }} + body_path: ./generated_release_note.txt + + - name: upload zip to release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./hsptest.zip + asset_name: hsptest.zip + asset_content_type: application/zip \ No newline at end of file