-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pushing a version tag triggers the creation of a draft github release with appropriate artifacts
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- 3.11.* | ||
- 3.12.* | ||
- 3.13.* | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: CHECKOUT | ||
uses: actions/checkout@v3 | ||
with: | ||
path: rules_erlang | ||
- name: ASSERT VERSIONS | ||
id: versions | ||
working-directory: rules_erlang | ||
run: | | ||
sudo npm install --global --silent @bazel/buildozer | ||
VERSION_BAZEL="$(cat MODULE.bazel | buildozer 'print version' -:%module)" | ||
if [[ "${{ github.ref_name }}" != "$VERSION_BAZEL" ]]; then | ||
echo "Version in MODULE.bazel ($VERSION_BAZEL) does not match tag (${{ github.ref_name }})" | ||
exit 1 | ||
fi | ||
echo "version=$VERSION_BAZEL" | tee -a $GITHUB_OUTPUT | ||
- name: FETCH THE SOURCE ARCHIVE | ||
run: | | ||
curl \ | ||
-L \ | ||
-o rules_erlang-${{ steps.versions.outputs.version }}.tar.gz \ | ||
https://github.com/${{ github.repository }}/archive/${{ github.ref }}.tar.gz | ||
- name: CREATE RELEASE | ||
id: create-release | ||
uses: ncipollo/release-action@v1.12.0 | ||
with: | ||
allowUpdates: true | ||
draft: true | ||
artifactErrorsFailBuild: true | ||
updateOnlyUnreleased: true | ||
generateReleaseNotes: true | ||
artifacts: >- | ||
rules_erlang-${{ steps.versions.outputs.version }}.tar.gz |