Skip to content

Commit

Permalink
Add release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kameffee authored Jan 9, 2022
1 parent 8f0ba8f commit a9a4887
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
name: release
runs-on: ubuntu-latest
env:
ROOT: Packages/AudioPlayer
steps:
- uses: actions/checkout@v2
- name: Get package
id: package
run: |
echo "::set-output name=data::$(cat ${{ env.ROOT }}/package.json | tr -d '\n')"
- name: Prepare
run: |
git subtree split -P "${{ env.ROOT }}" -b "${{ env.BRANCH }}"
git checkout "${{ env.BRANCH }}"
git mv Samples Samples~
rm -f Samples.meta
env:
BRANCH: release-tmp

- name: Push upm branch
run: |
git fetch
git reset --soft origin/upm
git checkout upm
git config --global user.name 'github-bot'
git config --global user.email '[email protected]'
git commit -am ${{ env.VERSION }}
git status
git push origin upm
env:
VERSION: "v${{ fromJson(steps.package.outputs.data).version }}"

- name: Add Tag
run: |
git tag -f ${{ env.TAG }}
git push -f origin ${{ env.TAG }}
env:
TAG: ${{ fromJson(steps.package.outputs.data).version }}

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ fromJson(steps.package.outputs.data).version }}"
release_name: "v${{ fromJson(steps.package.outputs.data).version }}"
body: https://github.com/kameffee/AudioPlayer.git#${{ fromJson(steps.package.outputs.data).version }}
draft: false
prerelease: false

0 comments on commit a9a4887

Please sign in to comment.