Update issue templates #25
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
on: | |
# workflow_dispatch | |
push: | |
branches: [main] | |
name: Windows | |
jobs: | |
build-windows: | |
name: "Build Windows for MS Store" | |
runs-on: windows-latest | |
timeout-minutes: 30 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2.4.0 | |
- name: create .env file | |
run: | | |
touch .env | |
echo SUBAPASE_URL=${{ secrets.SUBAPASE_URL }} >> .env | |
echo SUBAPASE_ANON_KEY=${{ secrets.SUBAPASE_ANON_KEY }} >> .env | |
echo SENTRY_DNS=${{ secrets.SENTRY_DNS }} >> .env | |
cat .env | |
- name: read yaml | |
id: read_action_js | |
uses: pietrobolcato/action-read-yaml@1.1.0 | |
with: | |
config: ${{ github.workspace }}/pubspec.yaml | |
- name: Create Version Number | |
id: versions | |
run: | | |
echo "::set-output name=version::${{ steps.read_action_js.outputs['version'] }}" | |
- name: Setup Flutter SDK | |
uses: subosito/flutter-action@v2.6.1 | |
with: | |
channel: "stable" | |
- name: Enable desktop | |
run: flutter config --enable-windows-desktop | |
- name: Generate MSIX-compatible version | |
uses: ashley-taylor/regex-property-action@1.2 | |
id: msixver | |
with: | |
value: ${{steps.versions.outputs.version }} | |
regex: (\-\w+)|(\+\w+) | |
replacement: "" | |
- name: Create PFX certificate | |
id: createPfx | |
shell: pwsh | |
env: | |
PFX_CONTENT: ${{ secrets.PROD_WIN_CERTIFICATE }} | |
run: | | |
$pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx"; | |
$encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT); | |
Set-Content $pfxPath -Value $encodedBytes -AsByteStream; | |
Write-Output "::set-output name=PFX_PATH::$pfxPath"; | |
- name: Write MSIX | |
uses: DamianReeves/write-file-action@v1.0 | |
with: | |
path: pubspec.yaml | |
contents: | | |
msix_config: | |
display_name: FlutterPP | |
msix_version: ${{steps.msixver.outputs.value }}.0 | |
logo_path: assets\windwos.png | |
architecture: x64 | |
capabilities: "internetClient,removableStorage" | |
certificate_path: ${{ steps.createPfx.outputs.PFX_PATH }} | |
certificate_password: ${{ secrets.PROD_WIN_CERTIFICATE_PWD }} | |
store: false | |
install_certificate: false | |
write-mode: append | |
- name: Flutter get packages | |
run: flutter pub get | |
- name: Flutter build app | |
run: flutter build windows | |
- name: Create MSIX | |
run: flutter pub run msix:create | |
- name: Delete PFX certificate | |
shell: pwsh | |
env: | |
PFX_PATH: ${{ steps.createPfx.outputs.PFX_PATH }} | |
run: | | |
Remove-Item -Path $env:PFX_PATH; | |
- name: Upload MSIX to release | |
uses: svenstaro/upload-release-action@2.9.0 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: build/windows/x64/runner/Release/flutterpp.msix | |
asset_name: FlutterPP-windows-${{ steps.versions.outputs.version }}-MS-NS.msix | |
tag: ${{ steps.versions.outputs.version }} | |
release_name: Release ${{ steps.versions.outputs.version }} | |
overwrite: true |