New Workflows for Automated Release (#870)
* Create release.yml * Create flatpak.yml * Update package.json * Update flatpak.yml * Update flatpak.yml * Update package.json * Update release.yml * Update flatpak.yml * Update package.json
This commit is contained in:
parent
a7b21e9fd9
commit
0c8d510028
|
@ -0,0 +1,123 @@
|
||||||
|
# This is a basic workflow that is manually triggered
|
||||||
|
|
||||||
|
name: Create Flatpak PR
|
||||||
|
|
||||||
|
# Controls when the action will run. Workflow runs when manually triggered using the UI
|
||||||
|
# or API.
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: flathub/io.freetubeapp.FreeTube
|
||||||
|
token: ${{ secrets.PUSH_TOKEN }}
|
||||||
|
- name: GitHub API exec action
|
||||||
|
uses: moustacheful/github-api-exec-action@v0
|
||||||
|
id: api_results
|
||||||
|
with:
|
||||||
|
# Command to execute, (e.g: `pulls.create`), see https://octokit.github.io/rest.js/ for available commands
|
||||||
|
command: repos.getRelease
|
||||||
|
payload: >
|
||||||
|
{
|
||||||
|
"owner": "PrestonN",
|
||||||
|
"repo": "FreeTube",
|
||||||
|
"release_id": ${{ secrets.UPLOAD_ID }}
|
||||||
|
}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Install xmlstarlet
|
||||||
|
run: sudo apt -y install xmlstarlet
|
||||||
|
- name: Create Version Variable
|
||||||
|
uses: bluwy/substitute-string-action@v1
|
||||||
|
id: sub
|
||||||
|
with:
|
||||||
|
_input-text: ${{ fromJson(steps.api_results.outputs.result).tag_name }}
|
||||||
|
-beta: ''
|
||||||
|
v: ''
|
||||||
|
- name: Create Release Branch
|
||||||
|
run: |
|
||||||
|
git checkout -b release-v${{ steps.sub.outputs.result }}
|
||||||
|
git push --set-upstream origin release-v${{ steps.sub.outputs.result }}
|
||||||
|
- name: Download x64 Release
|
||||||
|
uses: fabriciobastian/download-release-asset-action@v1.0.6
|
||||||
|
with:
|
||||||
|
version: v${{ steps.sub.outputs.result }}-beta
|
||||||
|
repository: FreeTubeApp/FreeTube
|
||||||
|
file: freetube-${{ steps.sub.outputs.result }}-linux-portable-x64.zip
|
||||||
|
- name: Download ARM Release
|
||||||
|
uses: fabriciobastian/download-release-asset-action@v1.0.6
|
||||||
|
with:
|
||||||
|
version: v${{ steps.sub.outputs.result }}-beta
|
||||||
|
repository: FreeTubeApp/FreeTube
|
||||||
|
file: freetube-${{ steps.sub.outputs.result }}-linux-portable-arm64.zip
|
||||||
|
- name: Set x64 Hash Variable
|
||||||
|
id: hash-x64
|
||||||
|
run: |
|
||||||
|
echo 'HASH_X64<<EOF' >> $GITHUB_ENV
|
||||||
|
sha256sum freetube-${{ steps.sub.outputs.result }}-linux-portable-x64.zip | awk '{print $1}' >> $GITHUB_ENV
|
||||||
|
echo 'EOF' >> $GITHUB_ENV
|
||||||
|
- name: Set ARM Hash Variable
|
||||||
|
id: hash-arm64
|
||||||
|
run: |
|
||||||
|
echo 'HASH_ARM64<<EOF' >> $GITHUB_ENV
|
||||||
|
sha256sum freetube-${{ steps.sub.outputs.result }}-linux-portable-arm64.zip | awk '{print $1}' >> $GITHUB_ENV
|
||||||
|
echo 'EOF' >> $GITHUB_ENV
|
||||||
|
- name: Set Date Variable
|
||||||
|
id: current-date
|
||||||
|
run: |
|
||||||
|
echo 'CURRENT_DATE<<EOF' >> $GITHUB_ENV
|
||||||
|
date +"%Y-%m-%d" >> $GITHUB_ENV
|
||||||
|
echo 'EOF' >> $GITHUB_ENV
|
||||||
|
- name: Update x64 File Location in yml File
|
||||||
|
uses: mikefarah/yq@4.0.0-beta1
|
||||||
|
with:
|
||||||
|
# The Command which should be run
|
||||||
|
cmd: yq w -i io.freetubeapp.FreeTube.yml modules[0].sources[0].url 'https://github.com/FreeTubeApp/FreeTube/releases/download/v${{ steps.sub.outputs.result }}-beta/freetube-${{ steps.sub.outputs.result }}-linux-portable-x64.zip'
|
||||||
|
- name: Update x64 Hash in yml File
|
||||||
|
uses: mikefarah/yq@4.0.0-beta1
|
||||||
|
with:
|
||||||
|
# The Command which should be run
|
||||||
|
cmd: yq w -i io.freetubeapp.FreeTube.yml modules[0].sources[0].sha256 ${{ env.HASH_X64 }}
|
||||||
|
- name: Update ARM File Location in yml File
|
||||||
|
uses: mikefarah/yq@4.0.0-beta1
|
||||||
|
with:
|
||||||
|
# The Command which should be run
|
||||||
|
cmd: yq w -i io.freetubeapp.FreeTube.yml modules[0].sources[1].url 'https://github.com/FreeTubeApp/FreeTube/releases/download/v${{ steps.sub.outputs.result }}-beta/freetube-${{ steps.sub.outputs.result }}-linux-portable-arm64.zip'
|
||||||
|
- name: Update ARM Hash in yml File
|
||||||
|
uses: mikefarah/yq@4.0.0-beta1
|
||||||
|
with:
|
||||||
|
# The Command which should be run
|
||||||
|
cmd: yq w -i io.freetubeapp.FreeTube.yml modules[0].sources[1].sha256 ${{ env.HASH_ARM64 }}
|
||||||
|
- name: Add Patch Notes to XML File
|
||||||
|
run: xmlstarlet ed -L -i /application/releases/release[1] -t elem -n releaseTMP -v "" -i //releaseTMP -t attr -n version -v "${{ steps.sub.outputs.result }} Beta" -i //releaseTMP -t attr -n date -v "${{ env.CURRENT_DATE }}" -s //releaseTMP -t elem -n url -v "" -s //releaseTMP/url -t text -n "" -v "https://github.com/FreeTubeApp/FreeTube/releases/tag/v${{ steps.sub.outputs.result }}-beta" -r //releaseTMP -v "release" io.freetubeapp.FreeTube.metainfo.xml
|
||||||
|
- name: Remove Release Files
|
||||||
|
run: |
|
||||||
|
rm freetube-${{ steps.sub.outputs.result }}-linux-portable-x64.zip
|
||||||
|
rm freetube-${{ steps.sub.outputs.result }}-linux-portable-arm64.zip
|
||||||
|
- name: Commit Files
|
||||||
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
|
with:
|
||||||
|
# Optional but recommended
|
||||||
|
# Defaults to "Apply automatic changes"
|
||||||
|
commit_message: Update files for v${{ steps.sub.outputs.result }}
|
||||||
|
token: ${{ secrets.PUSH_TOKEN }}
|
||||||
|
|
||||||
|
# Optional options appended to `git-commit`
|
||||||
|
# See https://git-scm.com/docs/git-commit for a list of available options
|
||||||
|
commit_options: '--no-verify --signoff'
|
||||||
|
|
||||||
|
# Optional: Disable dirty check and always try to create a commit and push
|
||||||
|
skip_dirty_check: true
|
||||||
|
- name: Create PR
|
||||||
|
run: |
|
||||||
|
echo ${{ secrets.PUSH_TOKEN }} >> auth.txt
|
||||||
|
gh auth login --with-token < auth.txt
|
||||||
|
rm auth.txt
|
||||||
|
gh pr create --title "Release v${{ steps.sub.outputs.result }}" --body "This is an automated PR for the v${{ steps.sub.outputs.result }} release. This PR will be updated and merge once testing is complete."
|
|
@ -0,0 +1,163 @@
|
||||||
|
# This is a basic workflow that is manually triggered
|
||||||
|
|
||||||
|
name: Upload Release
|
||||||
|
|
||||||
|
# Controls when the action will run. Workflow runs when manually triggered using the UI
|
||||||
|
# or API.
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [12.x]
|
||||||
|
runtime: [ linux-x64, linux-arm64, win-x64, osx-x64 ]
|
||||||
|
include:
|
||||||
|
- runtime: linux-x64
|
||||||
|
os: ubuntu-latest
|
||||||
|
|
||||||
|
- runtime: linux-arm64
|
||||||
|
os: ubuntu-latest
|
||||||
|
|
||||||
|
- runtime: osx-x64
|
||||||
|
os: macOS-latest
|
||||||
|
|
||||||
|
- runtime: win-x64
|
||||||
|
os: windows-latest
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm run lint
|
||||||
|
|
||||||
|
- name: Get Version Number
|
||||||
|
uses: nyaayaya/package-version@v1
|
||||||
|
with:
|
||||||
|
path: 'package.json'
|
||||||
|
follow-symlinks: false
|
||||||
|
|
||||||
|
- name: Build x64 with Node.js ${{ matrix.node-version}}
|
||||||
|
if: contains(matrix.runtime, 'x64')
|
||||||
|
run: npm run build --if-present
|
||||||
|
|
||||||
|
- name: Build ARM64 with Node.js ${{ matrix.node-version}}
|
||||||
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
|
||||||
|
run: npm run build:arm --if-present
|
||||||
|
|
||||||
|
- name: Upload AppImage x64 Release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
|
||||||
|
asset_name: freetube_${{ env.PACKAGE_VERSION }}_amd64.AppImage
|
||||||
|
asset_path: build/FreeTube-${{ env.PACKAGE_VERSION }}.AppImage
|
||||||
|
asset_content_type: application/vnd.appimage
|
||||||
|
|
||||||
|
- name: Upload Linux .zip x64 Release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
|
||||||
|
asset_name: freetube-${{ env.PACKAGE_VERSION }}-linux-portable-x64.zip
|
||||||
|
asset_path: build/freetube-${{ env.PACKAGE_VERSION }}.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
- name: Upload Linux .zip ARM Release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
|
||||||
|
asset_name: freetube-${{ env.PACKAGE_VERSION }}-linux-portable-arm64.zip
|
||||||
|
asset_path: build/freetube-${{ env.PACKAGE_VERSION }}-arm64.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
- name: Upload Linux .deb x64 Release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
|
||||||
|
asset_name: freetube_${{ env.PACKAGE_VERSION }}_amd64.deb
|
||||||
|
asset_path: build/freetube_${{ env.PACKAGE_VERSION }}_amd64.deb
|
||||||
|
asset_content_type: application/vnd.debian.binary-package
|
||||||
|
|
||||||
|
- name: Upload Linux .deb ARM Release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
|
||||||
|
asset_name: freetube_${{ env.PACKAGE_VERSION }}_arm64.deb
|
||||||
|
asset_path: build/freetube_${{ env.PACKAGE_VERSION }}_arm64.deb
|
||||||
|
asset_content_type: application/vnd.debian.binary-package
|
||||||
|
|
||||||
|
- name: Upload Linux .rpm x64 Release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
|
||||||
|
asset_name: freetube_${{ env.PACKAGE_VERSION }}_amd64.rpm
|
||||||
|
asset_path: build/freetube-${{ env.PACKAGE_VERSION }}.x86_64.rpm
|
||||||
|
asset_content_type: application/x-rpm
|
||||||
|
|
||||||
|
- name: Upload Linux .rpm ARM Release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
|
||||||
|
asset_name: freetube_${{ env.PACKAGE_VERSION }}_arm64.rpm
|
||||||
|
asset_path: build/freetube-${{ env.PACKAGE_VERSION }}.arm64.rpm
|
||||||
|
asset_content_type: application/x-rpm
|
||||||
|
|
||||||
|
- name: Upload Windows .exe Release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
if: startsWith(matrix.os, 'windows')
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
|
||||||
|
asset_name: freetube-${{ env.PACKAGE_VERSION }}-setup-x64.exe
|
||||||
|
asset_path: build/freetube Setup ${{ env.PACKAGE_VERSION }}.exe
|
||||||
|
asset_content_type: application/x-ms-dos-executable
|
||||||
|
|
||||||
|
- name: Upload Windows .zip Release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
if: startsWith(matrix.os, 'windows')
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
|
||||||
|
asset_name: freetube-${{ env.PACKAGE_VERSION }}-win-x64-portable
|
||||||
|
asset_path: build/freetube-${{ env.PACKAGE_VERSION }}-win.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
- name: Upload Mac .dmg Release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
if: startsWith(matrix.os, 'macos')
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
|
||||||
|
asset_name: freetube-${{ env.PACKAGE_VERSION }}-mac.dmg
|
||||||
|
asset_path: build/freetube-${{ env.PACKAGE_VERSION }}.dmg
|
||||||
|
asset_content_type: application/x-apple-diskimage
|
Loading…
Reference in New Issue