ci(deps): bump softprops/action-gh-release from 2 to 3 #142
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: Build OS | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "*" | |
| pull_request: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: true # if you use submodules | |
| - name: Build OS | |
| run: | | |
| make clean | |
| ./build.sh build | |
| - name: Sanitize tag name | |
| if: startsWith(github.ref, 'refs/tags/') | |
| id: sanitize_tag | |
| run: | | |
| SAFE_TAG_NAME=$(echo "${GITHUB_REF_NAME}" | tr '/ ' '_') | |
| echo "safe_tag_name=$SAFE_TAG_NAME" >> $GITHUB_ENV | |
| env: | |
| GITHUB_REF_NAME: ${{ github.ref_name }} | |
| - name: Rename OS binary to include sanitized tag | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| sudo mv ./bin/os.bin ./bin/os-${safe_tag_name}.bin | |
| sudo chown $USER:$USER ./bin/os-${safe_tag_name}.bin | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Build OS ${{ github.ref_name }} | |
| files: ./bin/os-${{ env.safe_tag_name }}.bin | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| safe_tag_name: ${{ env.safe_tag_name }} |