Update build-and-publish.yml #5
This file contains hidden or 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 Tests and Publish to GitHub Packages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# テスト実行と結果の保存 | |
- name: Run tests | |
run: | | |
mkdir -p test-results | |
echo "Test output" > test-results/results.txt | |
# テスト結果を tar アーカイブにまとめる | |
- name: Archive test results | |
run: | | |
tar -czvf test-results.tar.gz -C test-results . | |
# GitHub Packages にアーカイブをアップロード | |
- name: Publish to GitHub Packages | |
run: | | |
gh release create test-results "test-results.tar.gz" -t "Test Results" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |