Skip to content

Commit

Permalink
Release v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Apr 12, 2022
1 parent ef30384 commit 366b6ef
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 1 deletion.
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,75 @@
name: "Release"

# @see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
on:
push:
tags:
- v1*

jobs:
plugin:
name: release-plugin
runs-on: ubuntu-20.04

steps:
##################################################################################################################
##################################################################################################################
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@v2

# The github.ref is, for example, refs/tags/v5.0.145 or refs/tags/v5.0-r8
# Generate variables like:
# SRS_TAG=v5.0-r8
# SRS_TAG=v5.0.145
# @see https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Generate varaiables
run: |
SRS_TAG=$(echo ${{ github.ref }}| awk -F '/' '{print $3}')
echo "SRS_TAG=$SRS_TAG" >> $GITHUB_ENV
##################################################################################################################
##################################################################################################################
##################################################################################################################
# Create source tar for release. Note that it's for OpenWRT package srs-server, so the filename MUST be
# srs-server-xxx.tar.gz, because the package is named srs-server.
# Generate variables like:
# SRS_SOURCE_TAR=srs-player.zip
# SRS_SOURCE_MD5=83e38700a80a26e30b2df054e69956e5
- name: Create source tar.gz
run: |
DEST_DIR=srs-player && mkdir -p $DEST_DIR &&
cp README.md $DEST_DIR &&
zip -q -r ${DEST_DIR}.zip ${DEST_DIR} && du -sh ${DEST_DIR}* &&
echo "SRS_SOURCE_TAR=${DEST_DIR}.zip" >> $GITHUB_ENV &&
echo "SRS_SOURCE_MD5=$(md5sum ${DEST_DIR}.zip| awk '{print $1}')" >> $GITHUB_ENV
# Create release.
- 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 }}
body: |
[${{ github.event.head_commit.message }}](https://github.com/ossrs/WordPress-Plugin-SrsPlayer/commit/${{ github.sha }})
## Resource
* Source: ${{ env.SRS_SOURCE_MD5 }} [${{ env.SRS_SOURCE_TAR }}](https://github.com/ossrs/WordPress-Plugin-SrsPlayer/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_SOURCE_TAR }})
## Doc
* [Plugin](https://wordpress.org/plugins/srs-player)
* [Features](https://github.com/ossrs/WordPress-Plugin-SrsPlayer/blob/${{ github.sha }}/srs-player/readme.txt)
draft: false
prerelease: true

# Upload release source files
- name: Upload Release Assets Source
id: upload-release-assets-source
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: ${{ env.SRS_SOURCE_TAR }}
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 ossrs
Copyright (c) 2022 Winlin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
27 changes: 27 additions & 0 deletions auto/pub.sh
@@ -0,0 +1,27 @@
#!/bin/bash

REALPATH=$(realpath $0)
WORK_DIR=$(cd $(dirname $REALPATH)/.. && pwd)
echo "Run pub at $WORK_DIR from $0"
cd $WORK_DIR

git st |grep -q 'nothing to commit'
if [[ $? -ne 0 ]]; then
echo "Failed: Please commit before release";
exit 1
fi

RELEASE=$(git describe --tags --abbrev=0 --exclude release-*)
REVISION=$(echo $RELEASE|awk -F . '{print $3}')
let NEXT=$REVISION+1
echo "Last release is $RELEASE, revision is $REVISION, next is $NEXT"

TAG="v1.0.$NEXT"
echo "publish $TAG"

git push
git tag -d $TAG 2>/dev/null && git push origin :$TAG
git tag $TAG
git push origin $TAG
echo "publish $TAG ok"
echo " https://github.com/ossrs/WordPress-Plugin-SrsPlayer/tags"

0 comments on commit 366b6ef

Please sign in to comment.