Publish #11
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: Publish | |
on: | |
release: | |
types: [created] | |
jobs: | |
update-release-to-draft: | |
if: ${{ github.repository_owner == 'binary-blazer' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout git repo | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Install GitHub CLI | |
run: sudo apt-get install gh | |
- name: Authenticate GitHub CLI | |
run: echo "${{ secrets.PAT }}" | gh auth login --with-token | |
- name: Update release type to draft | |
env: | |
GH_TOKEN: ${{ secrets.PAT }} | |
run: | | |
gh release edit "${{ github.event.release.tag_name }}" --draft | |
publish-macos: | |
needs: update-release-to-draft | |
if: ${{ github.repository_owner == 'binary-blazer' }} | |
runs-on: macos-latest | |
steps: | |
- name: Checkout git repo | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install pnpm | |
run: | | |
npm install -g pnpm | |
- name: Install | |
run: | | |
pnpm install | |
pnpm install electron-ad-blocker | |
pnpm run postinstall | |
- name: Build | |
run: | | |
pnpm run build | |
- name: Publish release files | |
env: | |
GH_TOKEN: ${{ secrets.PAT }} | |
run: | | |
pnpm exec electron-builder -- --publish always --mac | |
publish-ubuntu: | |
needs: update-release-to-draft | |
if: ${{ github.repository_owner == 'binary-blazer' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout git repo | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install pnpm | |
run: | | |
npm install -g pnpm | |
- name: Install | |
run: | | |
pnpm install | |
pnpm install electron-ad-blocker | |
pnpm run postinstall | |
- name: Build | |
run: | | |
pnpm run build | |
- name: Publish release files | |
env: | |
GH_TOKEN: ${{ secrets.PAT }} | |
run: | | |
pnpm exec electron-builder -- --publish always --linux | |
publish-windows: | |
needs: update-release-to-draft | |
if: ${{ github.repository_owner == 'binary-blazer' }} | |
runs-on: windows-latest | |
steps: | |
- name: Checkout git repo | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Ensure Chocolatey is installed | |
run: | | |
if (-not (Get-Command choco -ErrorAction SilentlyContinue)) { | |
Set-ExecutionPolicy Bypass -Scope Process -Force; | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; | |
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); | |
} | |
- name: Install Visual Studio | |
run: | | |
choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.Node" | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install pnpm | |
run: | | |
npm install -g pnpm | |
- name: Install | |
run: | | |
pnpm install | |
pnpm install electron-ad-blocker | |
pnpm run postinstall | |
- name: Build | |
run: | | |
pnpm run build | |
- name: Publish release files | |
env: | |
GH_TOKEN: ${{ secrets.PAT }} | |
run: | | |
pnpm exec electron-builder -- --publish always --win | |
update-release-to-original: | |
needs: [publish-macos, publish-ubuntu, publish-windows] | |
if: ${{ github.repository_owner == 'binary-blazer' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout git repo | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Install GitHub CLI | |
run: sudo apt-get install gh | |
- name: Authenticate GitHub CLI | |
run: echo "${{ secrets.PAT }}" | gh auth login --with-token | |
- name: Update release type to original | |
env: | |
GH_TOKEN: ${{ secrets.PAT }} | |
run: | | |
gh release edit "${{ github.event.release.tag_name }}" --draft=false |