Skip to content

Create Release And Upload assets #185

Create Release And Upload assets

Create Release And Upload assets #185

Workflow file for this run

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release And Upload assets
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get version
id: get_version
run: |
TAG=$(basename ${GITHUB_REF})
VERSION=${TAG/v/}
echo "::set-output name=TAG::$TAG"
echo "::set-output name=VERSION::$VERSION"
- name: Create Release
id: create_release
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config-name: release-config.yml
version: ${{ steps.get_version.outputs.TAG }}
tag: ${{ steps.get_version.outputs.TAG }}
- uses: actions/setup-node@v2
with:
node-version: '16.5'
- uses: actions/setup-go@v2
with:
go-version: '1.19.x' # The Go version to download (if necessary) and use.
- name: Make Build
id: make_build
env:
VERSION: ${{ steps.get_version.outputs.TAG }}
run: |
make && ls build && ls ui
- name: Release Upload Assets
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
build/*.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: sync lion-release
env:
REPO_URL: jumpserver/lion-release
TAG_NAME: ${{ steps.get_version.outputs.TAG }}
BRANCH: master
ACCESS_TOKEN: ${{ secrets.PRIVATE_TOKEN }}
FILE_PATTERN: build/*.gz
run: |
wget "https://github.com/LeeEirc/ghaction/releases/download/v0.0.2/ghrcreate-linux-amd64"
chmod +x ghrcreate-linux-amd64 && ./ghrcreate-linux-amd64