Skip to content

Commit

Permalink
Add a release workflow
Browse files Browse the repository at this point in the history
pushing a version tag triggers the creation of a draft github release
with appropriate artifacts
  • Loading branch information
HoloRin committed Sep 11, 2023
1 parent 90cd276 commit b699f3f
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit b699f3f

Please sign in to comment.