Update blank.yml #28
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
name: Run Windows Script on Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set Date Tag | |
id: date_tag | |
run: echo "RELEASE_TAG=$(date -u +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Create Release | |
id: create_release | |
uses: octokit/request-action@v2.x | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
route: POST /repos/${{ github.repository }}/releases | |
body: | | |
{ | |
"tag_name": "${{ env.RELEASE_TAG }}", | |
"name": "Release ${{ env.RELEASE_TAG }}", | |
"draft": false, | |
"prerelease": false | |
} | |
- name: Install dependencies | |
run: | | |
# Install PowerShell package manager (required for PowerShellGet module) | |
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force | |
iex "& { $(irm https://aka.ms/install-powershell.ps1 -UseBasic) }" | |
- name: Build | |
shell: pwsh | |
run: | | |
Start-Process -FilePath ".\run.bat" -Wait -NoNewWindow | |
- name: Upload Exe Files | |
id: upload_files | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Output Files | |
path: ./Output | |
- name: Attach Artifacts to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.data.upload_url }} | |
asset_path: ${{ steps.upload_files.outputs.artifact_paths }} | |
asset_name: Output Files | |
asset_content_type: application/zip |