-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
118 additions
and
109 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,119 +1,128 @@ | ||
name: Release Artifacts | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
test-tauri: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
NAME: macos | ||
- os: ubuntu-latest | ||
NAME: linux | ||
- os: windows-latest | ||
NAME: windows | ||
runs-on: ${{ matrix.os}} | ||
env: | ||
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Install rust stable | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- name: Install webkit2gtk (ubuntu only) | ||
if: matrix.NAME == 'linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf | ||
- name: Install app dependencies and build it | ||
run: npm ci && npm run build:alpha | ||
- uses: tauri-apps/tauri-action@v0 | ||
test-tauri: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
NAME: macos | ||
- os: ubuntu-latest | ||
NAME: linux | ||
- os: windows-latest | ||
NAME: windows | ||
runs-on: ${{ matrix.os}} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Remove useless folders | ||
run: | | ||
rm -rf core/target/release/build | ||
rm -rf core/target/release/deps | ||
rm -rf core/target/release/bundle/appimage/authme.AppDir | ||
npm run rename | ||
shell: bash | ||
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Install rust stable | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- name: Install webkit2gtk (ubuntu only) | ||
if: matrix.NAME == 'linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf | ||
- name: Install app dependencies and build it | ||
run: npm ci && npm run build:alpha | ||
- uses: tauri-apps/tauri-action@v0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Remove useless folders | ||
run: | | ||
rm -rf core/target/release/build | ||
rm -rf core/target/release/deps | ||
rm -rf core/target/release/bundle/appimage/authme.AppDir | ||
npm run rename | ||
shell: bash | ||
|
||
- uses: octokit/request-action@v2.x | ||
id: get_latest_release | ||
with: | ||
route: GET /repos/:repository/releases?per_page=1 | ||
repository: ${{ github.repository }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: octokit/request-action@v2.x | ||
id: get_latest_release | ||
with: | ||
route: GET /repos/:repository/releases?per_page=1 | ||
repository: ${{ github.repository }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get upload url | ||
id: get_upload_url | ||
run: > | ||
url=$(echo "$response" | jq -r ".[0].upload_url") | ||
echo "::set-output name=url::$url" | ||
env: | ||
response: ${{ steps.get_latest_release.outputs.data }} | ||
shell: bash | ||
- name: Get upload url | ||
id: get_upload_url | ||
run: > | ||
url=$(echo "$response" | jq -r ".[0].upload_url") | ||
- name: Get version | ||
id: version | ||
uses: notiz-dev/github-action-json-property@release | ||
with: | ||
path: package.json | ||
prop_path: version | ||
echo "::set-output name=url::$url" | ||
env: | ||
response: ${{ steps.get_latest_release.outputs.data }} | ||
shell: bash | ||
|
||
# Windows | ||
- name: Upload the windows installer asset | ||
if: runner.os == 'Windows' | ||
uses: actions/upload-release-asset@v1.0.2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{steps.get_upload_url.outputs.url}} | ||
asset_path: ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-windows-x64.msi | ||
asset_name: authme-${{steps.version.outputs.prop}}-windows-x64.msi | ||
asset_content_type: application/octet-stream | ||
- name: Get version | ||
id: version | ||
uses: notiz-dev/github-action-json-property@release | ||
with: | ||
path: package.json | ||
prop_path: version | ||
|
||
# Linux | ||
- name: Upload the linux installer asset | ||
if: runner.os == 'Linux' | ||
uses: actions/upload-release-asset@v1.0.2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{steps.get_upload_url.outputs.url}} | ||
asset_path: ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-linux-x64.appimage | ||
asset_name: authme-${{steps.version.outputs.prop}}-linux-x64.appimage | ||
asset_content_type: application/octet-stream | ||
|
||
# Mac | ||
- name: Upload the mac installer asset | ||
if: runner.os == 'macOS' | ||
uses: actions/upload-release-asset@v1.0.2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{steps.get_upload_url.outputs.url}} | ||
asset_path: ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-macos-x64.dmg | ||
asset_name: authme-${{steps.version.outputs.prop}}-macos-x64.dmg | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Hash | ||
run: cat ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-${{matrix.NAME}}-x64.sig | ||
shell: bash | ||
# Windows | ||
- name: Upload the windows installer asset | ||
if: runner.os == 'Windows' | ||
uses: actions/upload-release-asset@v1.0.2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{steps.get_upload_url.outputs.url}} | ||
asset_path: ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-windows-x64.msi | ||
asset_name: authme-${{steps.version.outputs.prop}}-windows-x64.msi | ||
asset_content_type: application/octet-stream | ||
|
||
# Linux | ||
- name: Upload the linux installer asset | ||
if: runner.os == 'Linux' | ||
uses: actions/upload-release-asset@v1.0.2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{steps.get_upload_url.outputs.url}} | ||
asset_path: ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-linux-x64.appimage | ||
asset_name: authme-${{steps.version.outputs.prop}}-linux-x64.appimage | ||
asset_content_type: application/octet-stream | ||
- name: Upload the linux installer asset | ||
if: runner.os == 'Linux' | ||
uses: actions/upload-release-asset@v1.0.2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{steps.get_upload_url.outputs.url}} | ||
asset_path: ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-linux-x64.deb | ||
asset_name: authme-${{steps.version.outputs.prop}}-linux-x64.deb | ||
asset_content_type: application/octet-stream | ||
|
||
# Mac | ||
- name: Upload the mac installer asset | ||
if: runner.os == 'macOS' | ||
uses: actions/upload-release-asset@v1.0.2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{steps.get_upload_url.outputs.url}} | ||
asset_path: ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-macos-x64.dmg | ||
asset_name: authme-${{steps.version.outputs.prop}}-macos-x64.dmg | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Hash | ||
run: cat ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-${{matrix.NAME}}-x64.sig | ||
shell: bash | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: authme-latest-release-${{matrix.NAME}}-x64-installer-portable | ||
path: dist | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: authme-latest-release-${{matrix.NAME}}-x64-installer-portable | ||
path: dist |