From f1855a0e7d35e7b1932078bd2594aa0359623698 Mon Sep 17 00:00:00 2001 From: funbiscuit Date: Thu, 13 Oct 2022 22:23:00 +0300 Subject: [PATCH] Add release workflow --- .github/workflows/ci.yaml | 31 ++++++++++++++++++++++++++++++- .github/workflows/release.yaml | 22 ++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 86c7d40..ede04da 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,5 +56,34 @@ jobs: - name: Upload binary uses: actions/upload-artifact@v2 with: - name: spacedisplay-win64.exe + name: spacedisplay-win64 path: ${{github.workspace}}/target/release/spacedisplay-cli.exe + + add-release-assets: + runs-on: ubuntu-latest + if: github.event_name == 'release' + needs: [ build-win, build-linux ] + steps: + - uses: actions/download-artifact@v2 + with: + path: artifacts + + - name: Display structure of downloaded files + working-directory: artifacts + run: ls -R + + - uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/spacedisplay-win64/spacedisplay-cli.exe + tag: ${{ github.ref }} + asset_name: SpaceDisplay-msvc19-Win32.zip + overwrite: true + + - uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/spacedisplay-amd64_linux/spacedisplay-cli + tag: ${{ github.ref }} + asset_name: spacedisplay-amd64_linux + overwrite: true diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..2ecfbcd --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,22 @@ +name: Release +on: + push: + tags: + - '*' + +jobs: + create-release: + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + steps: + - name: version + run: echo "::set-output name=version::${GITHUB_REF##*/}" + id: version + + - name: Release + uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.RELEASE_ACCESS_TOKEN }} + name: spacedisplay ${{ steps.version.outputs.version }} + draft: false + prerelease: true