File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed
Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Auto Tag
2+
3+ on :
4+ schedule :
5+ - cron : ' 0 0 31 1 *'
6+
7+ env :
8+ NEXT_TAG : ' 41'
9+ SSH_REPO :
' [email protected] :${{ github.repository }}.git' 10+
11+ jobs :
12+ tag :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout
17+ 18+ - name : Checkout
19+ 20+ with :
21+ repository : ' rust-lang/rust'
22+ ref : ' 1.${{ env.NEXT_TAG }}.0'
23+ path : ' rust'
24+ - name : Get Clippy commit
25+ working-directory : rust
26+ run : |
27+ git submodule init src/tools/clippy
28+ CLIPPY_SHA=$(git submodule status -- src/tools/clippy | grep -o '\s[0-9a-f]*\s' | tr -d '[:space:]')
29+ echo "::set-env name=CLIPPY_SHA::$CLIPPY_SHA"
30+ - name : Set SSH deploy key
31+ run : |
32+ eval "$(ssh-agens -s)"
33+ ssh-add - <<< ${{ secrets.DEPLOY_KEY }}
34+ - name : Tag Clippy commit
35+ run : |
36+ git checkout $CLIPPY_SHA
37+ git tag 'rust-1.$NEXT_TAG.0'
38+ git push $SSH_REPO --tags
39+ - name : Update GHA Auto Tag
40+ run : |
41+ git checkout master
42+
43+ TIME=$(date -u +%s)
44+ let NEXT_RELEASE="$TIME+6*7*24*60*60"
45+ DATE=$(date -u --date="@$NEXT_RELEASE" +%-d\ %-m)
46+ CRON="0 0 $DATE *"
47+ sed -i "s/cron: '[0-9* ]*'/cron: '$CRON'/" .github/workflows/tag.yml
48+
49+ let NEW_TAG="$NEXT_TAG+1"
50+ sed -i "s/NEXT_TAG: '[0-9]*'/NEXT_TAG: '$NEW_TAG'/" .github/workflows/tag.yml
51+
52+ git add .github/workflows/tag.yml
53+ git commit -m "Update GHA tag workflow"
54+ git push $SSH_REPO
You can’t perform that action at this time.
0 commit comments