mirror of
https://github.com/podman-desktop/podman-desktop
synced 2026-04-21 17:47:22 +00:00
Change-Id: I9164749f1220e688fa56dea83183dde00d955c9a Signed-off-by: Florent Benoit <fbenoit@redhat.com>
132 lines
4.1 KiB
YAML
132 lines
4.1 KiB
YAML
#
|
|
# Copyright (C) 2022 Red Hat, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
name: release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version to release'
|
|
required: true
|
|
env:
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
DEBUG: electron-builder
|
|
|
|
jobs:
|
|
|
|
tag:
|
|
name: Tagging
|
|
runs-on: ubuntu-20.04
|
|
outputs:
|
|
githubTag: ${{ steps.TAG_UTIL.outputs.githubTag}}
|
|
desktopVersion: ${{ steps.TAG_UTIL.outputs.desktopVersion}}
|
|
releaseId: ${{ steps.create_release.outputs.id}}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Generate tag utilities
|
|
id: TAG_UTIL
|
|
run: |
|
|
TAG_PATTERN=${{ github.event.inputs.version }}
|
|
echo "::set-output name=githubTag::v$TAG_PATTERN"
|
|
echo "::set-output name=desktopVersion::$TAG_PATTERN"
|
|
- name: tag
|
|
run: |
|
|
git config --local user.name ${{ github.actor }}
|
|
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ steps.TAG_UTIL.outputs.desktopVersion }}\",#g" package.json
|
|
cat package.json
|
|
git add package.json
|
|
git commit -m "chore: tag ${{ steps.TAG_UTIL.outputs.githubTag }}"
|
|
echo "Tagging with ${{ steps.TAG_UTIL.outputs.githubTag }}"
|
|
git tag ${{ steps.TAG_UTIL.outputs.githubTag }}
|
|
git push origin ${{ steps.TAG_UTIL.outputs.githubTag }}
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ steps.TAG_UTIL.outputs.githubTag }}
|
|
release_name: ${{ steps.TAG_UTIL.outputs.githubTag }}
|
|
draft: true
|
|
prerelease: false
|
|
|
|
|
|
build:
|
|
name: Build / ${{ matrix.os }}
|
|
needs: tag
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [windows-2022, ubuntu-20.04, macos-11]
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
ref: ${{ needs.tag.outputs.githubTag}}
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 16
|
|
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Get yarn cache directory path
|
|
id: yarn-cache-dir-path
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- uses: actions/cache@v2
|
|
id: yarn-cache
|
|
with:
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-yarn-
|
|
|
|
- name: yarn
|
|
run: |
|
|
yarn --frozen-lockfile --network-timeout 180000
|
|
|
|
- name: Set macOS environment variables
|
|
if: ${{ matrix.os=='macos-11' }}
|
|
run: |
|
|
echo "CSC_LINK=${{secrets.CSC_LINK}}" >> $GITHUB_ENV
|
|
echo "CSC_KEY_PASSWORD=${{secrets.CSC_KEY_PASSWORD}}" >> $GITHUB_ENV
|
|
echo "APPLE_ID=${{secrets.APPLE_ID}}" >> $GITHUB_ENV
|
|
echo "APPLE_ID_PASSWORD=${{secrets.APPLE_ID_PASSWORD}}" >> $GITHUB_ENV
|
|
echo "APPLE_TEAM_ID=${{secrets.APPLE_TEAM_ID}}" >> $GITHUB_ENV
|
|
|
|
- name: Run Build
|
|
timeout-minutes: 20
|
|
run: yarn compile:next
|
|
|
|
release:
|
|
needs: [tag, build]
|
|
name: Release
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: id
|
|
run: echo the release id is ${{ needs.tag.outputs.releaseId}}
|
|
|
|
- name: Publish release
|
|
uses: StuYarrow/publish-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
id: ${{ needs.tag.outputs.releaseId}}
|