fix: タグ付きpushをした時buildが走るように #6
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
name: Release Workflow | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
jobs: | ||
build-windows: | ||
runs-on: windows-2019 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Build Docker image | ||
run: docker build -f ./windows/Dockerfile -t pyinstaller-windows . | ||
- name: Create dist directory | ||
run: mkdir windows\dist | ||
- name: Run Docker container | ||
run: docker run --rm -v "${{ github.workspace }}\windows\dist:C:\dist" pyinstaller-windows powershell -Command "pyinstaller main.py --onedir --onefile --clean --console --distpath C:\dist --workpath C:\build --specpath C:\" | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: minecraft-mods-localizer-windows | ||
path: windows/dist/main.exe | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Build Docker image | ||
run: docker build --no-cache -f ./linux/Dockerfile -t pyinstaller-linux . | ||
- name: Run Docker container | ||
id: run-container | ||
run: | | ||
docker run --rm -v $(pwd)/src:/src -v $(pwd)/linux:/linux \ | ||
pyinstaller-linux pyinstaller main.py \ | ||
--onedir --onefile --clean --console \ | ||
--distpath /linux/dist \ | ||
--workpath /linux/build \ | ||
--specpath /linux | ||
- name: Check Artifacts | ||
run: ls -R ./linux/dist | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: minecraft-mods-localizer-linux | ||
path: ./linux/dist/main | ||
create-release: | ||
needs: | ||
- build-linux | ||
- build-macos | ||
- build-windows | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Download artifact for Windows | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: minecraft-mods-localizer-windows | ||
path: artifacts/windows | ||
- name: Download artifact for MacOS | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: minecraft-mods-localizer-macos | ||
path: artifacts/macos | ||
- name: Download artifact for Linux | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: minecraft-mods-localizer-linux | ||
path: artifacts/linux | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: Description of the release | ||
draft: false | ||
prerelease: false | ||
- name: Upload Release Asset for Windows | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: artifacts/windows | ||
asset_name: minecraft-mods-localizer-windows.zip | ||
asset_content_type: application/zip | ||
- name: Upload Release Asset for MacOS | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: artifacts/macos | ||
asset_name: minecraft-mods-localizer-macos.zip | ||
asset_content_type: application/zip | ||
- name: Upload Release Asset for Linux | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: artifacts/linux | ||
asset_name: minecraft-mods-localizer-linux.zip | ||
asset_content_type: application/zip |