chore(deps): bump smol-toml from 1.3.0 to 1.3.1 #168
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
# build_stage.yaml | |
--- | |
name: Build and deploy | |
on: | |
pull_request: | |
types: [labeled] | |
env: | |
CSC_FOR_PULL_REQUEST: true | |
CI: true | |
S3_BUCKET: s3://spektr-stage-releases | |
STORING_DAYS: 60 | |
jobs: | |
internal-version-increment: | |
if: contains(github.event.label.name, 'internal-build') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get version from package.json | |
id: pkg | |
run: echo "::set-output name=version::$(node -p "require('./package.json').version")" | |
- name: Update version from secret | |
id: update_version | |
run: | | |
PKG_VERSION=${{ steps.pkg.outputs.version }} | |
INTERNAL_BUILD_VERSION=${{ secrets.INTERNAL_BUILD_VERSION }} | |
INTERNAL_BUILD_VERSION_BASE=${INTERNAL_BUILD_VERSION%-*} | |
if [[ $PKG_VERSION == "$INTERNAL_BUILD_VERSION_BASE" ]]; then | |
# Increment the last number of INTERNAL_BUILD_VERSION | |
NEW_VERSION=$(echo $INTERNAL_BUILD_VERSION | awk 'BEGIN{FS=OFS="-"} {n=split($NF, a, "."); if(n>1) $NF=a[1]"."a[2]+1; else $NF++;} 1') | |
else | |
NEW_VERSION="${PKG_VERSION}-1" | |
fi | |
echo "::set-output name=new_version::$NEW_VERSION" | |
shell: bash | |
- name: Write app version to secrets | |
uses: hmanzur/[email protected] | |
with: | |
name: 'INTERNAL_BUILD_VERSION' | |
value: ${{ steps.update_version.outputs.new_version }} | |
repository: novasamatech/nova-spektr | |
token: ${{ secrets.WRITE_SECRET_PAT }} | |
- name: Save nev version to artifacts | |
run: | | |
echo "${{ steps.update_version.outputs.new_version }}" > internal_version.txt | |
- name: Upload artifact with version | |
uses: actions/upload-artifact@v4 | |
with: | |
name: internal-version | |
path: | | |
internal_version.txt | |
internal-release-build: | |
runs-on: ${{ matrix.os }} | |
needs: internal-version-increment | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: internal-version | |
- name: Read internal-build version | |
id: internal-version | |
run: | | |
echo "::set-output name=version::$(cat internal_version.txt)" | |
- name: ⚙️ Install dependencies | |
uses: ./.github/workflows/install-pnpm | |
- name: Add MacOS certs | |
if: startsWith(matrix.os, 'macos') | |
run: chmod +x .github/add_cert_in_keychain.sh && .github/add_cert_in_keychain.sh | |
env: | |
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }} | |
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }} | |
- name: Update package.json | |
run: | | |
jq '.version = "${{ steps.internal-version.outputs.version }}"' package.json > temp.json && mv temp.json package.json | |
shell: bash | |
- name: Build app | |
env: | |
# secrets for notarization | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASS }} | |
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
run: | | |
pnpm stage:sequence | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifacts-${{ matrix.os }} | |
path: | | |
release/dist/*.exe | |
release/dist/*.dmg | |
release/dist/*.AppImage | |
internal-release-distribute: | |
needs: internal-release-build | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: build-artifacts-* | |
merge-multiple: true | |
- name: Debug | |
run: ls -la | |
- name: Replace space by "-" | |
run: | | |
for file in *; do | |
if [ -f "$file" ]; then | |
new_name=$(echo "$file" | tr ' ' '-') | |
if [ "$new_name" != "$file" ]; then # Skip files with no spaces | |
mv "$file" "$new_name" | |
fi | |
fi | |
done | |
- name: ⚙️ Install dependencies | |
uses: ./.github/workflows/setup-s3cmd | |
with: | |
s3_region: pl-waw | |
s3_access_key: ${{ secrets.S3_ACCESS_KEY }} | |
s3_secret_key: ${{ secrets.S3_SECRET_KEY }} | |
- name: Interact with object storage | |
id: interact_with_storage | |
run: | | |
declare -A artifacts=(["windows_app"]="*.exe" ["macos_64_app"]="*arm64.dmg" ["linux_app"]="*.AppImage" ["macos_app"]="*[!arm64].dmg") | |
for artifact_name in "${!artifacts[@]}"; do | |
artifact_pattern=${artifacts[$artifact_name]} | |
for artifact in $artifact_pattern; do | |
if [ -f "$artifact" ]; then | |
s3cmd sync "$artifact" --acl-public --multipart-chunk-size-mb=150 "${{ env.S3_BUCKET }}/pr-${{ github.event.pull_request.number }}/$artifact" | |
url=$(s3cmd signurl "${{ env.S3_BUCKET }}/pr-${{ github.event.pull_request.number }}/$artifact" $(echo "`date +%s` + 3600 * 24 * ${{ env.STORING_DAYS }}" | bc)) | |
echo "::set-output name=$artifact_name::[$artifact]($url)" | |
fi | |
done | |
done | |
- name: Notify Telegram channel | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO_DEV }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
format: html | |
message: | | |
👨💻 Stage build was created successfully, URLs to download: | |
- Windows: ${{ steps.interact_with_storage.outputs.windows_app }} | |
- Linux: ${{ steps.interact_with_storage.outputs.linux_app }} | |
- MacOS: ${{ steps.interact_with_storage.outputs.macos_app }} | |
- MacOS_arm: ${{ steps.interact_with_storage.outputs.macos_64_app }} | |
Branch: ${{ github.head_ref }} | |
PR: https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }} |