Skip to content

Commit

Permalink
Push tag as part of automated release
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Nov 15, 2024
1 parent 5ee0885 commit e41d0ae
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on: push
# schedule:
# - cron: "0 1 * * 0" # 01:00 on Sundays, https://crontab.guru/#0_1_*_*_0

permissions:
contents: write # to make release

jobs:
devstats-release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: stefanv/devstats-query-action@main
Expand All @@ -30,31 +32,36 @@ jobs:
with:
name: devstats-scientific-python

- uses: actions/checkout@v4
with:
repository: scientific-python/devstats
path: devstats

- name: Set variables
shell: bash
run: |
ISODATE=$(date +"%Y-%m-%d")
echo "ISODATE=$ISODATE" >> $GITHUB_ENV
- name: Bundle queries
- uses: actions/checkout@v4

- name: Push date as tag
shell: bash
run: |
FILENAME=$ISODATE-devstats-queries.tar.xz
tar cfJ $FILENAME --strip-components=3 devstats/devstats/queries/*
git config user.name github-actions
git config user.email github-actions@github.com
git tag -a $ISODATE -m "Release $ISODATE"
git push origin $ISODATE
- name: List all files
- uses: actions/checkout@v4
with:
repository: scientific-python/devstats
path: devstats

- name: Bundle queries
shell: bash
run: |
ls -R
FILENAME=$ISODATE-devstats-queries.tar.xz
tar cfJ $FILENAME --strip-components=3 devstats/devstats/queries/*
- name: Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.RELEASE_TOKEN }} # Needs to have Contents: read and write permission
tag_name: ${{ env.ISODATE }}
files: |
*.xz

0 comments on commit e41d0ae

Please sign in to comment.