Skip to content

Commit

Permalink
Release script tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiimk committed Sep 6, 2020
1 parent 1a41cf7 commit aec5ddc
Showing 1 changed file with 73 additions and 74 deletions.
147 changes: 73 additions & 74 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: release
#on:
# push:
# tags:
# - v[0-9]+.[0-9]+.[0-9]+*
on: [push]
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+*
env:
PACKAGE_NAME: kamu-cli
jobs:
Expand Down Expand Up @@ -63,72 +62,72 @@ jobs:
name: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}
path: target/${{ matrix.target }}/release/${{ env.PACKAGE_NAME }}.exe
if-no-files-found: error
# create_release:
# name: Create Release
# runs-on: ubuntu-latest
# needs: [build_linux, build_macos, build_windows]
# steps:
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# draft: false
# prerelease: false
# outputs:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# upload_assets_targz:
# name: Upload Assets (tar.gz)
# runs-on: ubuntu-latest
# needs: [create_release]
# strategy:
# matrix:
# target:
# - x86_64-unknown-linux-gnu
# - x86_64-unknown-linux-musl
# - x86_64-apple-darwin
# steps:
# - name: Download Artifact
# uses: actions/download-artifact@v2
# with:
# name: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}
# path: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}
# - name: Compress Artifacts
# run: tar -czvf ${{ env.PACKAGE_NAME }}-${{ matrix.target }}.tar.gz ${{ env.PACKAGE_NAME }}-${{ matrix.target }}
# - name: Upload Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ needs.create_release.outputs.upload_url }}
# asset_path: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}.tar.gz
# asset_name: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}.tar.gz
# asset_content_type: application/gzip
# upload_assets_zip:
# name: Upload Assets (zip)
# runs-on: ubuntu-latest
# needs: [create_release]
# strategy:
# matrix:
# target:
# - x86_64-pc-windows-msvc
# steps:
# - name: Download Artifact
# uses: actions/download-artifact@v2
# with:
# name: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}
# path: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}
# - name: Compress Artifacts
# run: zip -r ${{ env.PACKAGE_NAME }}-${{ matrix.target }}.zip ${{ env.PACKAGE_NAME }}-${{ matrix.target }}
# - name: Upload Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ needs.create_release.outputs.upload_url }}
# asset_path: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}.zip
# asset_name: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}.zip
# asset_content_type: application/gzip
create_release:
name: Create Release
runs-on: ubuntu-latest
needs: [build_linux, build_macos, build_windows]
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_assets_targz:
name: Upload Assets (tar.gz)
runs-on: ubuntu-latest
needs: [create_release]
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- x86_64-apple-darwin
steps:
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}
path: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}
- name: Compress Artifacts
run: tar -czvf ${{ env.PACKAGE_NAME }}-${{ matrix.target }}.tar.gz ${{ env.PACKAGE_NAME }}-${{ matrix.target }}
- name: Upload Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}.tar.gz
asset_name: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}.tar.gz
asset_content_type: application/gzip
upload_assets_zip:
name: Upload Assets (zip)
runs-on: ubuntu-latest
needs: [create_release]
strategy:
matrix:
target:
- x86_64-pc-windows-msvc
steps:
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}
path: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}
- name: Compress Artifacts
run: zip -r ${{ env.PACKAGE_NAME }}-${{ matrix.target }}.zip ${{ env.PACKAGE_NAME }}-${{ matrix.target }}
- name: Upload Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}.zip
asset_name: ${{ env.PACKAGE_NAME }}-${{ matrix.target }}.zip
asset_content_type: application/gzip

0 comments on commit aec5ddc

Please sign in to comment.