Dev/improve frontend dev (#732) #58
Workflow file for this run
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: goreleaser | |
on: | |
push: | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-20.04 | |
environment: releaser | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20.4' | |
cache: true | |
- name: Validate Plex version and tag | |
run: | | |
current_version=$(grep -oP 'CurrentPlexVersion\s*=\s*"\K[^"]+' cmd/upgrade.go) | |
tag_name=${GITHUB_REF#refs/tags/} | |
if [ "$current_version" != "$tag_name" ]; then | |
echo "CurrentPlexVersion in cmd/upgrade.go ($current_version) does not match tag ($tag_name)" | |
exit 1 | |
else | |
echo "CurrentPlexVersion in cmd/upgrade.go ($current_version) matches tag ($tag_name)" | |
fi | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get tag name and release name | |
id: tag_name | |
run: | | |
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}" | |
echo "::set-output name=release::${GITHUB_REF#refs/tags/v}" | |
- name: Download release file | |
run: curl -sSL https://github.com/labdao/plex/releases/download/${{ steps.tag_name.outputs.tag }}/plex_${{ steps.tag_name.outputs.release }}_linux_amd64.tar.gz -o plex_${{ steps.tag_name.outputs.release }}_linux_amd64.tar.gz | |
- name: Extract release file | |
run: tar -xvzf plex_${{ steps.tag_name.outputs.release }}_linux_amd64.tar.gz |