diff options
| author | Dan Engelbrecht <[email protected]> | 2022-06-15 14:51:31 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-06-15 14:51:31 +0200 |
| commit | a18d4975b509a9dd03612bdf348b41f8d97b5f8d (patch) | |
| tree | 62ec223157b539ec4880eff8a3f002a83d1714d4 | |
| parent | VERSION-tmp.txt -> VERSION.txt (diff) | |
| download | zen-a18d4975b509a9dd03612bdf348b41f8d97b5f8d.tar.xz zen-a18d4975b509a9dd03612bdf348b41f8d97b5f8d.zip | |
extract version name from VERSION.txt on release build
| -rw-r--r-- | .github/workflows/create_release.yml | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 2a4f3aee2..0f075a233 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -2,39 +2,14 @@ name: Create Release on: push: - # Sequence of patterns matched against refs/tags - tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + paths: + - 'version.txt' jobs: - bump-version-tag: - runs-on: [self-hosted, linux, x64] - - steps: - - uses: actions/checkout@v2 - - - name: Check prerelease - id: get-prerelease - uses: haya14busa/action-cond@v1 - with: - cond: ${{contains(github.ref, '-pre')}} - if_true: "true" - if_false: "false" - - - name: Update Version - if: ! ${{steps.get-prerelease.outputs.value}} - run: | - echo ${{ github.ref_name }} > version.txt - sed -i 's/##$/##\n\n## ${{ github.ref_name }}/' CHANGELOG.md - git add CHANGELOG.md version.txt - echo git commit -m"Bump version to ${{ github.ref_name }}" - echo git push - bundle-windows: runs-on: [self-hosted, windows, x64] env: VCPKG_VERSION: 2022.03.10 - ZEN_VERSION: ${{github.ref.name}} steps: - uses: actions/checkout@v2 @@ -64,7 +39,6 @@ jobs: xmake bundle -v -y env: VCPKG_ROOT: ${{ github.workspace }}/.vcpkg - ZEN_VERSION: ${{ github.ref_name }} - name: Upload zenserver-win64 uses: actions/upload-artifact@v3 @@ -110,7 +84,6 @@ jobs: xmake bundle -v -y env: VCPKG_ROOT: ${{ github.workspace }}/.vcpkg - ZEN_VERSION: ${{ github.ref_name }} - name: Upload zenserver-linux uses: actions/upload-artifact@v3 @@ -155,13 +128,19 @@ jobs: with: path: "CHANGELOG.tmp" + - name: Read VERSION.txt + id: read_version + uses: andstor/file-reader-action@v1 + with: + path: "VERSION.txt" + - name: Create Release id: create_release uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{github.ref.name}} + tag_name: v${{steps.read_version.outputs.contents}} body: | ${{steps.read_changelog.outputs.contents}} draft: false |