Skip to content

Commit

Permalink
Fix github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
foriequal0 committed Feb 12, 2020
1 parent 317fdd8 commit 97a7bad
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
33 changes: 21 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Release

on:
push:
Expand Down Expand Up @@ -29,7 +29,8 @@ jobs:
if: matrix.os.short != 'win'
working-directory: target/release
run: |
VERSION="${{git.ref}}"
VERSION="${{github.ref}}"
VERSION="${VERSION#refs/tags/}"
ARCHIVE="git-cleanup-${{matrix.os.short}}-$VERSION.tgz"
echo "::set-env name=VERSION::$VERSION"
echo "::set-env name=ARCHIVE::$ARCHIVE"
Expand All @@ -46,7 +47,7 @@ jobs:
if: matrix.os.short == 'win'
working-directory: target/release
run: |
$VERSION="${{git.ref}}"
$VERSION="${{github.ref}}".Substring("refs/tags/".Length)
$ARCHIVE="git-cleanup-${{matrix.os.short}}-$VERSION.zip"
echo "::set-env name=VERSION::$VERSION"
echo "::set-env name=ARCHIVE::$ARCHIVE"
Expand All @@ -70,18 +71,26 @@ jobs:
release:
needs:
- upload-artifacts
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- run: |
VERSION="${{github.ref}}"
VERSION="${VERSION#refs/tags/}"
echo "::set-env name=VERSION::$VERSION"
- uses: actions/download-artifact@v1
with:
name: git-cleanup-linux-${{github.ref}}
name: git-cleanup-linux-${{env.VERSION}}
path: ./
- uses: actions/download-artifact@v1
with:
name: git-cleanup-mac-${{github.ref}}
name: git-cleanup-mac-${{env.VERSION}}
path: ./
- uses: actions/download-artifact@v1
with:
name: git-cleanup-win-${{github.ref}}
name: git-cleanup-win-${{env.VERSION}}
path: ./

- name: Create Release
id: create_release
Expand All @@ -98,22 +107,22 @@ jobs:
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./git-cleanup-linux-${{github.ref}}.tgz
asset_name: git-cleanup-linux-${{github.ref}}.tgz
asset_path: ./git-cleanup-linux-${{env.VERSION}}.tgz
asset_name: git-cleanup-linux-${{env.VERSION}}.tgz
asset_content_type: application/gzip

- name: Upload Release Asset - mac
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./git-cleanup-mac-${{github.ref}}.tgz
asset_name: git-cleanup-mac-${{github.ref}}.tgz
asset_path: ./git-cleanup-mac-${{env.VERSION}}.tgz
asset_name: git-cleanup-mac-${{env.VERSION}}.tgz
asset_content_type: application/zip

- name: Upload Release Asset - win
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./git-cleanup-win-${{github.ref}}.zip
asset_name: git-cleanup-win-${{github.ref}}.zip
asset_path: ./git-cleanup-win-${{env.VERSION}}.zip
asset_name: git-cleanup-win-${{env.VERSION}}.zip
asset_content_type: application/zip
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Git Cleanup
===========

[![CI](https://github.com/foriequal0/git-cleanup/workflows/CI/badge.svg?event=push)](https://github.com/foriequal0/git-cleanup/actions?query=workflow%3ACI)
[![Release](https://github.com/foriequal0/git-cleanup/workflows/Release/badge.svg?event=push)](https://github.com/foriequal0/git-cleanup/actions?query=workflow%3ARelease)

Automatically trims your branches.

0 comments on commit 97a7bad

Please sign in to comment.