|
| 1 | +name: Create Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + # Sequence of patterns matched against refs/tags |
| 6 | + tags: |
| 7 | + - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 |
| 8 | + |
| 9 | +jobs: |
| 10 | + create_release: |
| 11 | + name: Create Release |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Get version from tag |
| 15 | + id: tag_name |
| 16 | + run: | |
| 17 | + echo "current_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT |
| 18 | + shell: bash |
| 19 | + - name: Checkout code |
| 20 | + uses: actions/checkout@v4 |
| 21 | + - name: Login to GitHub Container Registry |
| 22 | + uses: docker/login-action@v3 |
| 23 | + with: |
| 24 | + registry: ghcr.io |
| 25 | + username: ${{ github.repository_owner }} |
| 26 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 27 | + - name: Build and run Dev Container task |
| 28 | + uses: devcontainers/ci@v0.3 |
| 29 | + with: |
| 30 | + # Change this to point to your image name |
| 31 | + imageName: ghcr.io/${{ github.repository_owner }}/ebbflowcontrol-devcontainer |
| 32 | + # Change this to be your CI task/script |
| 33 | + runCmd: | |
| 34 | + ./build_all.sh |
| 35 | +
|
| 36 | + ## https://github.com/tj-actions/docker-cp |
| 37 | + ## Copy the build files from the dev container to the host |
| 38 | + - name: Copy build files |
| 39 | + uses: tj-actions/docker-cp@v1 |
| 40 | + with: |
| 41 | + src: /workspace/build_app/EbbFlowControl.bin |
| 42 | + dest: ./workspace/app.bin |
| 43 | + container: ebbflowcontrol-devcontainer |
| 44 | + - name: Copy build files |
| 45 | + uses: tj-actions/docker-cp@v1 |
| 46 | + with: |
| 47 | + src: /workspace/build_factory/EbbFlowControl.bin |
| 48 | + dest: ./workspace/factory.bin |
| 49 | + container: ebbflowcontrol-devcontainer |
| 50 | + |
| 51 | + - name: Get Changelog Entry |
| 52 | + id: changelog_reader |
| 53 | + uses: mindsers/changelog-reader-action@v2 |
| 54 | + with: |
| 55 | + validation_level: warn |
| 56 | + version: ${{ steps.tag_name.outputs.current_version }} |
| 57 | + path: ./CHANGELOG.md |
| 58 | + - name: Create Release |
| 59 | + id: create_release |
| 60 | + uses: softprops/action-gh-release@v2 |
| 61 | + with: |
| 62 | + tag_name: ${{ steps.changelog_reader.outputs.version }} |
| 63 | + name: Release ${{ steps.changelog_reader.outputs.version }} |
| 64 | + body: ${{ steps.changelog_reader.outputs.changes }} |
| 65 | + prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }} |
| 66 | + draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }} |
| 67 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 68 | + artifacts: ./workspace/app.bin,./workspace/factory.bin |
0 commit comments