-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable automatic release on version change (#2829)
* Use version file This commit create a VERSION file that can be used to obtain the current version of P4C. The current version string "1.2.0+g202103291035~a69e52" contains a semantic version, date and current git commit. However, the date makes sense only in packages. Building the same P4C compiler code on a different day should not result in a different version name. The current git commit is automatically from the git history. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org> * ci: rename 'release' action to 'static-build' This GitHub action doesn't create a release, it only tests if a static build works on Ubuntu 20.04. Thus, using the name "static build" looks more accurately describes what it does. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org> * Enable automatic releases This GitHub action creates a release in GitHub every time the Version.txt file has been changed. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
- Loading branch information
Showing
4 changed files
with
50 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
name: "release-p4c" | ||
name: GitHub Release | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
branches: | ||
- main | ||
paths: | ||
- 'Version.txt' | ||
jobs: | ||
# Build a p4c release on Ubuntu 16.04 | ||
build-linux: | ||
strategy: | ||
fail-fast: false | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
CTEST_PARALLEL_LEVEL: 4 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Build (Linux) | ||
run: | | ||
tools/start_ccache | ||
docker build --network ccache_network -t p4c --build-arg IMAGE_TYPE=build --build-arg ENABLE_UNIFIED_COMPILATION=ON --build-arg BUILD_STATIC_RELEASE=ON --build-arg ENABLE_GMP=ON . | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get version | ||
run: | | ||
VERSION="v$(cat Version.txt)" | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ env.VERSION }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: "static-build-test-p4c" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
# Build a p4c release on Ubuntu 16.04 | ||
build-linux: | ||
strategy: | ||
fail-fast: false | ||
runs-on: ubuntu-latest | ||
env: | ||
CTEST_PARALLEL_LEVEL: 4 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Build (Linux) | ||
run: | | ||
tools/start_ccache | ||
docker build --network ccache_network -t p4c --build-arg IMAGE_TYPE=build --build-arg ENABLE_UNIFIED_COMPILATION=ON --build-arg BUILD_STATIC_RELEASE=ON --build-arg ENABLE_GMP=ON . |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.2.2 |