Skip to content

Publish release

Publish release #6

Workflow file for this run

name: Publish release
on:
workflow_dispatch:
inputs:
major:
description: 'Major'
required: true
type: number
minor:
description: 'Minor'
required: true
type: number
patch:
description: 'Patch'
required: true
type: number
tag:
description: 'Tag'
required: false
type: string
prerelease:
description: 'Prerelease'
required: true
type: boolean
jobs:
build:
runs-on: windows-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
strategy:
matrix:
platform: ["x64", "ARM64"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup Conan
run: pip install conan
- name: Load Conan cache
uses: actions/cache@v4
with:
path: ~/.conan2/p
key: Conan-${{ hashFiles('src/**/conanfile.txt') }}-${{ matrix.platform }}
- name: Generate tag
id: tag
run: |
$tag = "${{ inputs.tag }}" -eq "" ? "v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}" : "${{ inputs.tag }}"
echo "tag=$tag" >> $env:GITHUB_OUTPUT
- name: Build
run: python publish.py ${{ matrix.platform }} unpackaged certs\Magpie.pfx "${{ secrets.MAGPIE_PFX_PASSWORD }}"
env:
MAJOR: ${{ inputs.major }}
MINOR: ${{ inputs.minor }}
PATCH: ${{ inputs.patch }}
TAG: ${{ steps.tag.outputs.tag }}
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: Magpie-${{ steps.tag.outputs.tag }}-${{ matrix.platform }}
path: publish/${{ matrix.platform }}
release:
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup Requests
run: pip install requests
- name: Restore artifacts
uses: actions/download-artifact@v4
with:
path: publish
- name: Publish release
run: python ci/release.py
env:
MAJOR: ${{ inputs.major }}
MINOR: ${{ inputs.minor }}
PATCH: ${{ inputs.patch }}
TAG: ${{ needs.build.outputs.tag }}
PRERELEASE: ${{ inputs.prerelease }}
ACCESS_TOKEN: ${{ secrets.CONTENTS_ACCESS_TOKEN }}