MediaWarp v0.0.5 #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MediaWarp Releaser | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- internal/config/version.go | |
env: | |
APP_NAME: MediaWarp | |
jobs: | |
app-info: | |
runs-on: ubuntu-latest | |
outputs: | |
app_version: ${{ steps.get-version.outputs.app_version }} | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v4 | |
- name: APP Version | |
id: get-version | |
run: | | |
APP_VERSION=$(cat internal/config/version.go | sed -ne 's/const\sAPP_VERSION\sstring\s=\s"v\(.*\)"/\1/gp') | |
echo "检测到版本号为 $APP_VERSION" | |
echo "app_version=$APP_VERSION" >> "$GITHUB_OUTPUT" | |
docker-builder: | |
name: Docker Image Builder | |
needs: app-info | |
uses: ./.github/workflows/docker-builder.yaml | |
with: | |
APP_VERSION: ${{ needs.app-info.outputs.app_version }} | |
IS_LATEST: true | |
secrets: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
binary-builder: | |
name: Binary Image Builder | |
needs: app-info | |
uses: ./.github/workflows/binary-builder.yaml | |
with: | |
APP_VERSION: ${{ needs.app-info.outputs.app_version }} | |
create-release: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
needs: [ app-info, docker-builder, binary-builder ] | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v4 | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: ${{ env.APP_NAME }}-${{ needs.app-info.outputs.app_version }}-* | |
merge-multiple: true | |
path: ${{ github.workspace }}/bin | |
- name: Create Release | |
uses: softprops/action-gh-release@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: v${{ needs.app-info.outputs.app_version }} | |
tag_name: v${{ needs.app-info.outputs.app_version }} | |
body: ${{ github.event.head_commit.message }} | |
files: | | |
${{ github.workspace }}/bin/* | |
${{ github.workspace }}/config/config.yaml.example | |
draft: false | |
prerelease: false |