Skip to content

Commit

Permalink
Create tag once in ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
riquito committed May 31, 2020
1 parent 7a44ba0 commit c94a590
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
with:
fetch-depth: "0"

- name: Check
run: cargo check --locked

- name: Get version from Cargo.toml
id: version-by-cargo
run: |
Expand All @@ -31,6 +34,14 @@ jobs:
run: |
echo "::set-output name=result::$(test $(git tag --list ${{ steps.version-by-cargo.outputs.version }}) && echo "" || echo ${{ steps.version-by-cargo.outputs.version }})"
- name: Push tag/create release point
id: apply-tag
if: steps.is-new-version.outputs.result != ''
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_TAG: ${{ steps.is-new-version.outputs.result }}

release:
needs: check-if-needs-release
if: needs.check-if-needs-release.outputs.new_version != ''
Expand All @@ -57,18 +68,11 @@ jobs:
- name: Build project
run: cargo build --release --locked

- name: Bump version and push tag/create release point
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_TAG: ${{ needs.check-if-needs-release.outputs.new_version }}
id: bump_version

- name: Upload binary to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ steps.bump_version.outputs.new_tag }}
tag: ${{ needs.check-if-needs-release.outputs.new_version }}
overwrite: true

0 comments on commit c94a590

Please sign in to comment.