|
| 1 | +name: CI-Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - master |
| 8 | + |
| 9 | +jobs: |
| 10 | + clang-format: |
| 11 | + runs-on: ubuntu-22.04 |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + - name: clang-format |
| 15 | + run: | |
| 16 | + docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./src |
| 17 | + build-binary: |
| 18 | + runs-on: ubuntu-22.04 |
| 19 | + needs: clang-format |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v2 |
| 22 | + - name: build binary |
| 23 | + run: | |
| 24 | + docker build . -t builder |
| 25 | + docker run --rm -v ${PWD}:/project builder make |
| 26 | + - uses: actions/upload-artifact@master |
| 27 | + with: |
| 28 | + name: binary |
| 29 | + path: "*.wps" |
| 30 | + deploy-binary: |
| 31 | + needs: build-binary |
| 32 | + runs-on: ubuntu-22.04 |
| 33 | + steps: |
| 34 | + - name: Get environment variables |
| 35 | + id: get_repository_name |
| 36 | + run: | |
| 37 | + echo REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//") >> $GITHUB_ENV |
| 38 | + echo DATETIME=$(echo $(date '+%Y%m%d-%H%M%S')) >> $GITHUB_ENV |
| 39 | + - uses: actions/download-artifact@master |
| 40 | + with: |
| 41 | + name: binary |
| 42 | + - name: zip artifact |
| 43 | + run: zip -r ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip *.wps |
| 44 | + - name: Create Release |
| 45 | + id: create_release |
| 46 | + uses: actions/create-release@v1 |
| 47 | + env: |
| 48 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + with: |
| 50 | + tag_name: ${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }} |
| 51 | + release_name: Nightly-${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }} |
| 52 | + draft: false |
| 53 | + prerelease: true |
| 54 | + body: | |
| 55 | + Not a stable release: |
| 56 | + ${{ github.event.head_commit.message }} |
| 57 | + - name: Upload Release Asset |
| 58 | + id: upload-release-asset |
| 59 | + uses: actions/upload-release-asset@v1 |
| 60 | + env: |
| 61 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 62 | + with: |
| 63 | + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps |
| 64 | + asset_path: ./${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip |
| 65 | + asset_name: ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip |
| 66 | + asset_content_type: application/zip |
0 commit comments