Release v1.2.8 #20
Workflow file for this run
This file contains hidden or 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: Publish to Zebar Marketplace | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version number (e.g., 1.0.0 or v1.0.0). Leave empty to use latest release." | |
| type: string | |
| required: false | |
| jobs: | |
| get-version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.get-version.outputs.version }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get version | |
| id: get-version | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| if [ -n "${{ github.event.release.tag_name }}" ]; then | |
| echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT | |
| elif [ -n "${{ github.event.inputs.version }}" ]; then | |
| echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | |
| else | |
| TAG=$(gh release view --json tagName -q '.tagName') | |
| echo "version=$TAG" >> $GITHUB_OUTPUT | |
| fi | |
| build: | |
| needs: get-version | |
| uses: ./.github/workflows/build.yml | |
| with: | |
| version-number: ${{ needs.get-version.outputs.version }} | |
| publish: | |
| if: github.event_name == 'workflow_dispatch' || github.event.release.draft == false | |
| runs-on: ubuntu-latest | |
| needs: [get-version, build] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get release info | |
| id: release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| RELEASE_BODY: ${{ github.event.release.body }} | |
| run: | | |
| TAG="${{ needs.get-version.outputs.version }}" | |
| if [ "${{ github.event_name }}" == "release" ]; then | |
| echo "url='${{ github.event.release.html_url }}'" >> $GITHUB_OUTPUT | |
| echo "body=$(echo "$RELEASE_BODY" | base64 -w 0)" >> $GITHUB_OUTPUT | |
| else | |
| RELEASE_JSON=$(gh release view "$TAG" --json body,url) | |
| echo "url=$(echo "$RELEASE_JSON" | jq -r '.url')" >> $GITHUB_OUTPUT | |
| echo "body=$(echo "$RELEASE_JSON" | jq -r '.body' | base64 -w 0)" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Extract version from tag | |
| id: version | |
| run: | | |
| TAG="${{ needs.get-version.outputs.version }}" | |
| echo "version=${TAG#v}" >> $GITHUB_OUTPUT | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build | |
| path: build/ | |
| - name: Download Zebar | |
| uses: robinraju/release-downloader@v1 | |
| with: | |
| repository: glzr-io/zebar | |
| tag: "v3.1.1" | |
| fileName: "*x64.deb" | |
| out-file-path: "." | |
| - name: Install Zebar dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libappindicator3-1 libwebkit2gtk-4.1-0 xvfb | |
| - name: Extract Zebar CLI | |
| run: | | |
| dpkg-deb -x *x64.deb ./zebar-extracted | |
| sudo cp ./zebar-extracted/usr/bin/zebar /usr/local/bin/ | |
| sudo chmod +x /usr/local/bin/zebar | |
| - name: Test Zebar Installation | |
| run: | | |
| export DISPLAY=:99 | |
| Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | |
| sleep 2 | |
| zebar --version | |
| - name: Publish to Zebar marketplace | |
| env: | |
| ZEBAR_PUBLISH_TOKEN: ${{ secrets.ZEBAR_PUBLISH_TOKEN }} | |
| run: | | |
| export DISPLAY=:99 | |
| zebar publish --pack-config ./build/zpack.json \ | |
| --version-override ${{ steps.version.outputs.version }} \ | |
| --commit-sha $(git rev-parse --short ${{ github.sha }}) \ | |
| --release-notes "$(echo ${{ steps.release.outputs.body }} | base64 --decode)" \ | |
| --release-url ${{ steps.release.outputs.url }} |